Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with incorrectly processed signed payload in pre-signed URL #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions src/Signature/S3SignatureV4.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,13 @@ public function presign(
if (!$request->hasHeader('x-amz-content-sha256')) {
$request = $request->withHeader(
'X-Amz-Content-Sha256',
$this->getPresignedPayload($request)
SignatureV4::UNSIGNED_PAYLOAD
);
}

return parent::presign($request, $credentials, $expires, $options);
}

/**
* Override used to allow pre-signed URLs to be created for an
* in-determinate request payload.
*/
protected function getPresignedPayload(RequestInterface $request)
{
return SignatureV4::UNSIGNED_PAYLOAD;
}

/**
* Amazon S3 does not double-encode the path component in the canonical request
*/
Expand Down