fix(copy-object): forward request-payer to the source-size HEAD - #654
Open
TingDaoK wants to merge 4 commits into
Open
fix(copy-object): forward request-payer to the source-size HEAD#654TingDaoK wants to merge 4 commits into
TingDaoK wants to merge 4 commits into
Conversation
Every CopyObject meta-request first issues a HEAD on the source object to learn its size, before any small-vs-multipart branching. That HEAD is built from a fresh aws_http_message in aws_s3_get_source_object_size_message_new() and inherited none of the original request's headers, so x-amz-request-payer was never sent on it. Against a Requester Pays bucket the size HEAD is rejected with 403 and the whole copy fails, even though the later bypass / multipart-copy sub-requests do forward the header. Forward x-amz-request-payer onto the source-size HEAD in both the copy_source_uri branch and the x-amz-copy-source fallback branch. Also map the CopyObject source-owner assertion (x-amz-source-expected-bucket-owner) onto the HEAD's x-amz-expected-bucket-owner. The destination x-amz-expected-bucket-owner is intentionally not forwarded: asserting the destination owner on a read of the source object would break legitimate cross-account copies.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #654 +/- ##
==========================================
- Coverage 89.14% 89.13% -0.02%
==========================================
Files 23 23
Lines 8044 8061 +17
==========================================
+ Hits 7171 7185 +14
- Misses 873 876 +3
🚀 New features to boost your workflow:
|
|
Fixes #652 |
1 task
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.