diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2025-08-22 16:58:09 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-22 16:58:09 -0700 |
| commit | 34773c8e138b7f35f68f2b289051b441993e92fd (patch) | |
| tree | 0f75d985e0c278d3ffe1af163f187c883ce4327d /weed/s3api/s3err/s3api_errors.go | |
| parent | 50530e25539313b1d34e50d32fc4a01ad12259a8 (diff) | |
| download | seaweedfs-34773c8e138b7f35f68f2b289051b441993e92fd.tar.xz seaweedfs-34773c8e138b7f35f68f2b289051b441993e92fd.zip | |
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
Diffstat (limited to 'weed/s3api/s3err/s3api_errors.go')
| -rw-r--r-- | weed/s3api/s3err/s3api_errors.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/s3api/s3err/s3api_errors.go b/weed/s3api/s3err/s3api_errors.go index 78ba8d2da..9cc343680 100644 --- a/weed/s3api/s3err/s3api_errors.go +++ b/weed/s3api/s3err/s3api_errors.go @@ -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.", |
