mirror of
https://github.com/versity/versitygw.git
synced 2026-01-07 12:15:18 +00:00
fix: adds error routes to reject x-amz-copy-source for GET, POST, HEAD, DELETErequests
Fixes #1612 `x-amz-copy-source` is rejected with an **InvalidArgument** error in S3 for all HTTP methods other than **PUT** (i.e., **GET**, **POST**, **HEAD**, and **DELETE**). For **POST** requests, the behavior is slightly different: the error is returned only when the **uploadId** query parameter is present; otherwise, **MethodNotAllowed** is returned. This behavior applies to both bucket-level and object-level operations.
This commit is contained in:
@@ -1087,6 +1087,7 @@ func TestRouter(ts *TestState) {
|
||||
ts.Run(RouterPostObjectWithoutQuery)
|
||||
ts.Run(RouterPUTObjectOnlyUploadId)
|
||||
ts.Run(RouterGetUploadsWithKey)
|
||||
ts.Run(RouterCopySourceNotAllowed)
|
||||
}
|
||||
|
||||
type IntTest func(s3 *S3Conf) error
|
||||
@@ -1724,5 +1725,6 @@ func GetIntTests() IntTests {
|
||||
"RouterPostObjectWithoutQuery": RouterPostObjectWithoutQuery,
|
||||
"RouterPUTObjectOnlyUploadId": RouterPUTObjectOnlyUploadId,
|
||||
"RouterGetUploadsWithKey": RouterGetUploadsWithKey,
|
||||
"RouterCopySourceNotAllowed": RouterCopySourceNotAllowed,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user