aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api/s3api_bucket_handlers.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2025-07-18 15:58:07 -0700
committerchrislu <chris.lu@gmail.com>2025-07-18 15:58:07 -0700
commit7203c78e4d3046a9a2006cf521a4921be07d193c (patch)
treebb9cda0aefb69e9c6d30c9f950fca7720d293589 /weed/s3api/s3api_bucket_handlers.go
parent1bc503530a4e7c566242e0b9067f18daec2a349c (diff)
downloadseaweedfs-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_bucket_handlers.go')
-rw-r--r--weed/s3api/s3api_bucket_handlers.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/s3api/s3api_bucket_handlers.go b/weed/s3api/s3api_bucket_handlers.go
index 2ecac4d11..591aaafb3 100644
--- a/weed/s3api/s3api_bucket_handlers.go
+++ b/weed/s3api/s3api_bucket_handlers.go
@@ -753,13 +753,13 @@ func (s3a *S3ApiServer) PutBucketVersioningHandler(w http.ResponseWriter, r *htt
}
status := *versioningConfig.Status
- if status != "Enabled" && status != "Suspended" {
+ if status != s3_constants.VersioningEnabled && status != s3_constants.VersioningSuspended {
s3err.WriteErrorResponse(w, r, s3err.ErrInvalidRequest)
return
}
// Check if trying to suspend versioning on a bucket with object lock enabled
- if status == "Suspended" {
+ if status == s3_constants.VersioningSuspended {
// Get bucket configuration to check for object lock
bucketConfig, errCode := s3a.getBucketConfig(bucket)
if errCode == s3err.ErrNone && bucketConfig.ObjectLockConfig != nil {