From b3aa2fab9ab4f79da7deb5b70c528cdcbe32dc3f Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 20 Oct 2020 10:25:16 -0700 Subject: s3: report error to s3 when updating an object but it is already a directory fix https://github.com/chrislusf/seaweedfs/issues/1545 --- weed/s3api/s3err/s3api_errors.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'weed/s3api/s3err/s3api_errors.go') 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. -- cgit v1.2.3