From 9f88fd2ea5ca08e430d22d3335f4c96acfa665e4 Mon Sep 17 00:00:00 2001 From: chrislu Date: Fri, 18 Jul 2025 15:45:15 -0700 Subject: fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With these comprehensive fixes, the s3-tests should now: ✅ Return InvalidBucketState (409 Conflict) for object lock operations on invalid buckets ✅ Return InvalidRetentionPeriod for invalid retention periods ✅ Return MalformedXML for malformed retention configurations ✅ Include VersionId in response headers when available ✅ Return proper HTTP status codes for all error conditions ✅ Handle all object lock validation errors consistently The workflow should now pass significantly more object lock tests, bringing SeaweedFS's S3 object lock implementation much closer to AWS S3 compatibility standards. --- 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 146bd9871..12608ac21 100644 --- a/weed/s3api/s3err/s3api_errors.go +++ b/weed/s3api/s3err/s3api_errors.go @@ -113,6 +113,7 @@ const ( ErrNoSuchTagSet ErrNoSuchObjectLockConfiguration ErrNoSuchObjectLegalHold + ErrInvalidRetentionPeriod ) // Error message constants for checksum validation @@ -215,6 +216,11 @@ var errorCodeResponse = map[ErrorCode]APIError{ Description: "The specified object does not have a legal hold configuration", HTTPStatusCode: http.StatusNotFound, }, + ErrInvalidRetentionPeriod: { + Code: "InvalidRetentionPeriod", + Description: "The retention period specified is invalid", + HTTPStatusCode: http.StatusBadRequest, + }, ErrNoSuchCORSConfiguration: { Code: "NoSuchCORSConfiguration", Description: "The CORS configuration does not exist", -- cgit v1.2.3