Skip to content

Conversation

@soberm
Copy link
Contributor

@soberm soberm commented Nov 24, 2025

Description of changes

Removed the incorrect x-amz-content-sha256 query parameter from S3 presigned URLs to comply with AWS S3 Signature Version 4 specification.

According to the AWS S3 documentation for presigned URLs, the x-amz-content-sha256 header is only used for regular authenticated requests (with Authorization header), not for presigned URLs. For presigned URLs, UNSIGNED-PAYLOAD should be used internally during signature calculation but should not appear as a query parameter in the final URL.

Changes:

  • Removed the line that incorrectly added x-amz-content-sha256 to presigned URL query parameters
  • Removed unused imports (EMPTY_SHA256_HASH and CONTENT_SHA256_HEADER)
  • Updated tests to verify the parameter is not present in presigned URLs
  • The implementation now correctly passes body: UNSIGNED_PAYLOAD to presignUrl() for internal signature calculation only

Issue #, if available

#14604

Description of how you validated changes

Checklist

  • PR description included
  • yarn test passes
  • Unit Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

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

@soberm soberm requested a review from a team as a code owner November 24, 2025 13:05
@soberm soberm force-pushed the fix/content-sha256-header branch from 29fa5f1 to 75d7282 Compare November 24, 2025 14:54
@soberm soberm added the run-tests run the pr-label workflow label Nov 25, 2025
@soberm soberm force-pushed the fix/content-sha256-header branch from 88371e0 to 5e559d0 Compare November 25, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-tests run the pr-label workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants