fix: fixes missing bucket object lock config error

Fixes #1751

When an object lock–related operation is performed on an object in a bucket where Object Lock is not enabled, an `InvalidRequest` error is returned; however, the error message differs for some actions. This PR introduces a new error, `ErrMissingObjectLockConfigurationNoSpaces`, for `PutObject`, `CopyObject`, and `CreateMultipartUpload` to maintain compatibility with S3 in terms of the error message. It also adds the missing integration tests for these actions.
This commit is contained in:
niksis02
2026-01-14 13:41:50 +04:00
parent 5979e056e1
commit 2a7e76a44f
11 changed files with 126 additions and 18 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ func GetObjectRetention_disabled_lock(s *S3Conf) error {
Key: &key,
})
cancel()
if err := checkApiErr(err, s3err.GetAPIError(s3err.ErrInvalidBucketObjectLockConfiguration)); err != nil {
if err := checkApiErr(err, s3err.GetAPIError(s3err.ErrMissingObjectLockConfiguration)); err != nil {
return err
}