Skip to content

fix(copy-object): forward request-payer to the source-size HEAD - #654

Open
TingDaoK wants to merge 4 commits into
mainfrom
copy-forward
Open

fix(copy-object): forward request-payer to the source-size HEAD#654
TingDaoK wants to merge 4 commits into
mainfrom
copy-forward

Conversation

@TingDaoK

@TingDaoK TingDaoK commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:

  • trivial fix and format on original PR

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

ph-tgs and others added 2 commits July 8, 2026 10:40
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-commenter

codecov-commenter commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.35294% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.13%. Comparing base (469cbd0) to head (72ba1d9).

Files with missing lines Patch % Lines
source/s3_request_messages.c 82.35% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            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     
Files with missing lines Coverage Δ
source/s3_request_messages.c 73.49% <82.35%> (+0.29%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ph-tgs

ph-tgs commented Jul 9, 2026

Copy link
Copy Markdown

Fixes #652

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants