mirror of
https://github.com/versity/versitygw.git
synced 2026-01-05 11:24:52 +00:00
fix: adds validation for chunk sizes in unsigned streaming trailer upload
Fixes #1665 S3 enforces a validation rule for unsigned streaming payload trailer uploads: all chunk sizes must be greater than 8192 bytes except for the final chunk. This fix adds a check in the unsigned chunk reader that validates chunk sizes by comparing each chunk size to the previous one.
This commit is contained in:
@@ -180,6 +180,7 @@ const (
|
||||
ErrInvalidLocationConstraint
|
||||
ErrInvalidArgument
|
||||
ErrMalformedTrailer
|
||||
ErrInvalidChunkSize
|
||||
|
||||
// Non-AWS errors
|
||||
ErrExistingObjectIsDirectory
|
||||
@@ -804,6 +805,11 @@ var errorCodeResponse = map[ErrorCode]APIError{
|
||||
Description: "The request contained trailing data that was not well-formed or did not conform to our published schema.",
|
||||
HTTPStatusCode: http.StatusBadRequest,
|
||||
},
|
||||
ErrInvalidChunkSize: {
|
||||
Code: "InvalidChunkSizeError",
|
||||
Description: "Only the last chunk is allowed to have a size less than 8192 bytes",
|
||||
HTTPStatusCode: http.StatusBadRequest,
|
||||
},
|
||||
|
||||
// non aws errors
|
||||
ErrExistingObjectIsDirectory: {
|
||||
|
||||
Reference in New Issue
Block a user