diff options
| author | chrislu <chris.lu@gmail.com> | 2025-07-18 15:58:07 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2025-07-18 15:58:07 -0700 |
| commit | 7203c78e4d3046a9a2006cf521a4921be07d193c (patch) | |
| tree | bb9cda0aefb69e9c6d30c9f950fca7720d293589 /weed/s3api/s3api_object_handlers_put.go | |
| parent | 1bc503530a4e7c566242e0b9067f18daec2a349c (diff) | |
| download | seaweedfs-7203c78e4d3046a9a2006cf521a4921be07d193c.tar.xz seaweedfs-7203c78e4d3046a9a2006cf521a4921be07d193c.zip | |
constants and fixes
✅ Return InvalidRetentionPeriod for invalid retention values (0 days, negative years)
✅ Return ObjectLockConfigurationNotFoundError when object lock configuration doesn't exist
✅ 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 | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/s3api/s3api_object_handlers_put.go b/weed/s3api/s3api_object_handlers_put.go index 446b78fde..71f2bc2d8 100644 --- a/weed/s3api/s3api_object_handlers_put.go +++ b/weed/s3api/s3api_object_handlers_put.go @@ -566,9 +566,9 @@ func mapValidationErrorToS3Error(err error) s3err.ErrorCode { case errors.Is(err, ErrInvalidRetentionDateFormat): return s3err.ErrMalformedXML case errors.Is(err, ErrInvalidRetentionPeriod): - // For invalid retention periods (days/years), return MalformedXML - // This includes cases where both Days and Years are specified - return s3err.ErrMalformedXML + // For invalid retention periods (0 days, negative years, etc.), return InvalidRetentionPeriod + // This includes cases where retention values are out of valid ranges + return s3err.ErrInvalidRetentionPeriod case errors.Is(err, ErrInvalidRetentionMode): // For invalid retention modes, return MalformedXML // This includes cases where ObjectLockEnabled is 'Disabled' |
