Skip to content

Commit

Permalink
Fixing an error in signing empty sigv4 requests. Closes aws#383.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtdowling committed Nov 12, 2014
1 parent deb24e5 commit 191d3bc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Aws/S3/S3SignatureV4.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ class S3SignatureV4 extends SignatureV4 implements S3SignatureInterface
public function signRequest(RequestInterface $request, CredentialsInterface $credentials)
{
if (!$request->hasHeader('x-amz-content-sha256')) {
$request->setHeader('x-amz-content-sha256', $this->getPresignedPayload($request));
$request->setHeader(
'x-amz-content-sha256',
parent::getPresignedPayload($request)
);
}

parent::signRequest($request, $credentials);
Expand Down

0 comments on commit 191d3bc

Please sign in to comment.