From b54a65ba5afcec13743442357a8544ec8cf876f5 Mon Sep 17 00:00:00 2001 From: zerospiel Date: Thu, 3 Feb 2022 17:17:05 +0300 Subject: weed/s3api: added new bucket handlers for more compatibility with AWS S3 Protocol Otherwise any requests to the underlying handlers results in calls to ListObjects (v1) that may intensively load gateway and volume servers. Added the following handlers with default responses: - GetBucketLocation - GetBucketRequestPayment Added the following handlers with NotFound and NotImplemented responses: - PutBucketAcl - GetBucketPolicy - PutBucketPolicy - DeleteBucketPolicy - GetBucketCors - PutBucketCors - DeleteBucketCors --- weed/s3api/s3err/s3api_errors.go | 12 ++++++++++++ 1 file changed, 12 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 3063df844..8d02f15b1 100644 --- a/weed/s3api/s3err/s3api_errors.go +++ b/weed/s3api/s3err/s3api_errors.go @@ -51,6 +51,8 @@ const ( ErrBucketAlreadyExists ErrBucketAlreadyOwnedByYou ErrNoSuchBucket + ErrNoSuchBucketPolicy + ErrNoSuchCORSConfiguration ErrNoSuchLifecycleConfiguration ErrNoSuchKey ErrNoSuchUpload @@ -164,6 +166,16 @@ var errorCodeResponse = map[ErrorCode]APIError{ Description: "The specified bucket does not exist", HTTPStatusCode: http.StatusNotFound, }, + ErrNoSuchBucketPolicy: { + Code: "NoSuchBucketPolicy", + Description: "The bucket policy does not exist", + HTTPStatusCode: http.StatusNotFound, + }, + ErrNoSuchCORSConfiguration: { + Code: "NoSuchCORSConfiguration", + Description: "The CORS configuration does not exist", + HTTPStatusCode: http.StatusNotFound, + }, ErrNoSuchLifecycleConfiguration: { Code: "NoSuchLifecycleConfiguration", Description: "The lifecycle configuration does not exist", -- cgit v1.2.3