S3 API: conditional read and write (#7154)
* conditional put * more tests * check all conditions * address comments * conditional multipart complete * conditional reads Read Operations (GET, HEAD): If-None-Match / If-Modified-Since failures → 304 Not Modified ✅ If-Match / If-Unmodified-Since failures → 412 Precondition Failed ✅ Write Operations (PUT, CompleteMultipartUpload): All conditional failures → 412 Precondition Failed ✅ Copy Operations (CopyObject): Copy-source conditionals → 412 Precondition Failed (already implemented) ✅ * test actual code * Interface-Based Testing * cleanup * Testing Interface * Update s3api_object_handlers_put.go * refactor
This commit is contained in:
@@ -102,6 +102,7 @@ const (
|
||||
ErrAuthNotSetup
|
||||
ErrNotImplemented
|
||||
ErrPreconditionFailed
|
||||
ErrNotModified
|
||||
|
||||
ErrExistingObjectIsDirectory
|
||||
ErrExistingObjectIsFile
|
||||
@@ -451,6 +452,11 @@ var errorCodeResponse = map[ErrorCode]APIError{
|
||||
Description: "At least one of the pre-conditions you specified did not hold",
|
||||
HTTPStatusCode: http.StatusPreconditionFailed,
|
||||
},
|
||||
ErrNotModified: {
|
||||
Code: "NotModified",
|
||||
Description: "The object was not modified since the specified time",
|
||||
HTTPStatusCode: http.StatusNotModified,
|
||||
},
|
||||
ErrExistingObjectIsDirectory: {
|
||||
Code: "ExistingObjectIsDirectory",
|
||||
Description: "Existing Object is a directory.",
|
||||
|
||||
Reference in New Issue
Block a user