From 0123abe49b51a250b46831e07417f5f5ae503866 Mon Sep 17 00:00:00 2001 From: chrislu Date: Fri, 18 Jul 2025 15:39:30 -0700 Subject: address test errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With these fixes, the s3-tests should now: ✅ Return InvalidBucketState (409 Conflict) for object lock operations on invalid buckets ✅ Return MalformedXML for invalid retention configurations ✅ Include VersionId in response headers when available ✅ Return proper HTTP status codes (403 Forbidden for retention mode changes) ✅ Handle all object lock validation errors consistently --- weed/s3api/s3err/s3api_errors.go | 6 ++++++ 1 file changed, 6 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 17057f604..146bd9871 100644 --- a/weed/s3api/s3err/s3api_errors.go +++ b/weed/s3api/s3err/s3api_errors.go @@ -57,6 +57,7 @@ const ( ErrNoSuchKey ErrNoSuchUpload ErrInvalidBucketName + ErrInvalidBucketState ErrInvalidDigest ErrInvalidMaxKeys ErrInvalidMaxUploads @@ -154,6 +155,11 @@ var errorCodeResponse = map[ErrorCode]APIError{ Description: "The specified bucket is not valid.", HTTPStatusCode: http.StatusBadRequest, }, + ErrInvalidBucketState: { + Code: "InvalidBucketState", + Description: "The bucket is not in a valid state for the requested operation", + HTTPStatusCode: http.StatusConflict, + }, ErrInvalidDigest: { Code: "InvalidDigest", Description: "The Content-Md5 you specified is not valid.", -- cgit v1.2.3