diff options
| author | chrislu <chris.lu@gmail.com> | 2025-07-18 16:03:06 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2025-07-18 16:03:06 -0700 |
| commit | 1807f4e94d3ebe8ae91f59fc34d49cd5795ac891 (patch) | |
| tree | 7510868e497544ee8aa8f4144873257c9a9c7f12 /weed/s3api/s3api_object_handlers_put.go | |
| parent | 7203c78e4d3046a9a2006cf521a4921be07d193c (diff) | |
| download | seaweedfs-1807f4e94d3ebe8ae91f59fc34d49cd5795ac891.tar.xz seaweedfs-1807f4e94d3ebe8ae91f59fc34d49cd5795ac891.zip | |
fixes
✅ Return MalformedXML when both Days and Years are specified in the same retention configuration
✅ Return 400 (Bad Request) with InvalidRequest when object lock operations are attempted on buckets without object lock enabled
✅ Handle all object lock validation errors consistently with proper error codes
Diffstat (limited to 'weed/s3api/s3api_object_handlers_put.go')
| -rw-r--r-- | weed/s3api/s3api_object_handlers_put.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/weed/s3api/s3api_object_handlers_put.go b/weed/s3api/s3api_object_handlers_put.go index 71f2bc2d8..b79d31bab 100644 --- a/weed/s3api/s3api_object_handlers_put.go +++ b/weed/s3api/s3api_object_handlers_put.go @@ -565,6 +565,10 @@ func mapValidationErrorToS3Error(err error) s3err.ErrorCode { return s3err.ErrMalformedXML case errors.Is(err, ErrInvalidRetentionDateFormat): return s3err.ErrMalformedXML + case errors.Is(err, ErrBothDaysAndYearsSpecified): + // For cases where both Days and Years are specified, return MalformedXML + // This is a specific s3-tests expectation + return s3err.ErrMalformedXML case errors.Is(err, ErrInvalidRetentionPeriod): // For invalid retention periods (0 days, negative years, etc.), return InvalidRetentionPeriod // This includes cases where retention values are out of valid ranges |
