fix: adds an error route for object calls with ?uploads query arg

Fixes #1597

S3 returns a specific error when calling an object GET operation (e.g., `bucket/object/key?uploads`) with the `?uploads` query parameter. It’s not the standard `MethodNotAllowed` error. This PR adds support for handling this specific error route.
This commit is contained in:
niksis02
2025-11-13 19:21:00 +04:00
parent 371dccfde9
commit 9f54a25519
4 changed files with 33 additions and 0 deletions

View File

@@ -123,6 +123,7 @@ const (
ErrInvalidAccessKeyID
ErrRequestNotReadyYet
ErrMissingDateHeader
ErrGetUploadsWithKey
ErrInvalidRequest
ErrAuthNotSetup
ErrNotImplemented
@@ -515,6 +516,11 @@ var errorCodeResponse = map[ErrorCode]APIError{
Description: "AWS authentication requires a valid Date or x-amz-date header.",
HTTPStatusCode: http.StatusBadRequest,
},
ErrGetUploadsWithKey: {
Code: "InvalidRequest",
Description: "Key is not expected for the GET method ?uploads subresource",
HTTPStatusCode: http.StatusBadRequest,
},
ErrInvalidRequest: {
Code: "InvalidRequest",
Description: "Invalid Request.",