fix(storage): use unsigned payload for pre-signed urls #14636
+49
−16
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.
Description of changes
Removed the incorrect
x-amz-content-sha256query 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-sha256header is only used for regular authenticated requests (with Authorization header), not for presigned URLs. For presigned URLs,UNSIGNED-PAYLOADshould be used internally during signature calculation but should not appear as a query parameter in the final URL.Changes:
x-amz-content-sha256to presigned URL query parametersEMPTY_SHA256_HASHandCONTENT_SHA256_HEADER)body: UNSIGNED_PAYLOADtopresignUrl()for internal signature calculation onlyIssue #, if available
#14604
Description of how you validated changes
x-amz-content-sha256as a query parameteryarn testin the storage packageChecklist
yarn testpassesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.