diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-10-20 10:25:16 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-10-20 10:25:16 -0700 |
| commit | b3aa2fab9ab4f79da7deb5b70c528cdcbe32dc3f (patch) | |
| tree | f857f94d6b45045827727dee330da5cbbb6b4d61 /weed/s3api/s3err/s3api_errors.go | |
| parent | 7fc98da709f9582bc27fad64bd2d718d6b7c5173 (diff) | |
| download | seaweedfs-b3aa2fab9ab4f79da7deb5b70c528cdcbe32dc3f.tar.xz seaweedfs-b3aa2fab9ab4f79da7deb5b70c528cdcbe32dc3f.zip | |
s3: report error to s3 when updating an object but it is already a directory
fix https://github.com/chrislusf/seaweedfs/issues/1545
Diffstat (limited to 'weed/s3api/s3err/s3api_errors.go')
| -rw-r--r-- | weed/s3api/s3err/s3api_errors.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/weed/s3api/s3err/s3api_errors.go b/weed/s3api/s3err/s3api_errors.go index f95652afb..a3f7bb25e 100644 --- a/weed/s3api/s3err/s3api_errors.go +++ b/weed/s3api/s3err/s3api_errors.go @@ -92,6 +92,8 @@ const ( ErrMissingDateHeader ErrInvalidRequest ErrNotImplemented + + ErrExistingObjectIsDirectory ) // error code to APIError structure, these fields carry respective @@ -344,6 +346,11 @@ var errorCodeResponse = map[ErrorCode]APIError{ Description: "A header you provided implies functionality that is not implemented", HTTPStatusCode: http.StatusNotImplemented, }, + ErrExistingObjectIsDirectory: { + Code: "ExistingObjectIsDirectory", + Description: "Existing Object is a directory.", + HTTPStatusCode: http.StatusConflict, + }, } // GetAPIError provides API Error for input API error code. |
