diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2025-11-20 11:42:22 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-20 11:42:22 -0800 |
| commit | 5f77f8733511d6d2bc4f47df7c477c4f9c25a727 (patch) | |
| tree | 10c58807bcba42022c8ccb6df44f181297d2b40a /weed/s3api/s3api_bucket_handlers_object_lock_config.go | |
| parent | 6281e62d7f6cfbc6632de05829897bbd0fd2c992 (diff) | |
| download | seaweedfs-5f77f8733511d6d2bc4f47df7c477c4f9c25a727.tar.xz seaweedfs-5f77f8733511d6d2bc4f47df7c477c4f9c25a727.zip | |
S3: S3 Object Retention API to include XML namespace support (#7517)
* Refactor S3 Object Retention API to include XML namespace support and improve compatibility with Veeam. Updated XML tags to remove hardcoded namespaces and added test cases for retention and legal hold configurations without namespaces.
* Added XMLNS field setting in both places
Diffstat (limited to 'weed/s3api/s3api_bucket_handlers_object_lock_config.go')
| -rw-r--r-- | weed/s3api/s3api_bucket_handlers_object_lock_config.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/s3api/s3api_bucket_handlers_object_lock_config.go b/weed/s3api/s3api_bucket_handlers_object_lock_config.go index c779f80d7..23b52648e 100644 --- a/weed/s3api/s3api_bucket_handlers_object_lock_config.go +++ b/weed/s3api/s3api_bucket_handlers_object_lock_config.go @@ -86,6 +86,9 @@ func (s3a *S3ApiServer) GetObjectLockConfigurationHandler(w http.ResponseWriter, // Check if we have cached Object Lock configuration if bucketConfig.ObjectLockConfig != nil { + // Set namespace for S3 compatibility + bucketConfig.ObjectLockConfig.XMLNS = s3_constants.S3Namespace + // Use cached configuration and marshal it to XML for response marshaledXML, err := xml.Marshal(bucketConfig.ObjectLockConfig) if err != nil { @@ -139,6 +142,9 @@ func (s3a *S3ApiServer) GetObjectLockConfigurationHandler(w http.ResponseWriter, // not just ObjectLockConfig, before resetting the TTL s3a.updateBucketConfigCacheFromEntry(freshEntry) + // Set namespace for S3 compatibility + objectLockConfig.XMLNS = s3_constants.S3Namespace + // Marshal and return the configuration marshaledXML, err := xml.Marshal(objectLockConfig) if err != nil { |
