Skip to content

Commit

Permalink
fix(gmdate) : time zone error fixed in signature requests
Browse files Browse the repository at this point in the history
  • Loading branch information
halil-ulu committed Oct 14, 2020
1 parent e2d9e99 commit 3537c57
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
42 changes: 21 additions & 21 deletions src/AwsSignature/SignatureV4.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,27 @@ class SignatureV4 implements SignatureInterface
private function getHeaderBlacklist()
{
return [
'cache-control' => true,
'content-length' => true,
'expect' => true,
'max-forwards' => true,
'pragma' => true,
'range' => true,
'te' => true,
'if-match' => true,
'if-none-match' => true,
'if-modified-since' => true,
'if-unmodified-since' => true,
'if-range' => true,
'accept' => true,
'authorization' => true,
'proxy-authorization' => true,
'from' => true,
'referer' => true,
'user-agent' => true,
'x-amzn-trace-id' => true,
'cache-control' => true,
'content-length' => true,
'expect' => true,
'max-forwards' => true,
'pragma' => true,
'range' => true,
'te' => true,
'if-match' => true,
'if-none-match' => true,
'if-modified-since' => true,
'if-unmodified-since' => true,
'if-range' => true,
'accept' => true,
'authorization' => true,
'proxy-authorization' => true,
'from' => true,
'referer' => true,
'user-agent' => true,
'x-amzn-trace-id' => true,
'aws-sdk-invocation-id' => true,
'aws-sdk-retry' => true,
'aws-sdk-retry' => true,
];
}

Expand All @@ -51,7 +51,7 @@ public function SignatureForAWS(RequestInterface $request, $credentials)
$parseRequest = $this->parseRequest($request);
$payload = $this->getPayload($request);

$largeDateTime = date(self::ISO8601_BASIC);
$largeDateTime = gmdate(self::ISO8601_BASIC);
$shortDateTime = substr($largeDateTime, 0, 8);

$scope = $this->createScope($shortDateTime, $credentials['region'], $credentials['service']);
Expand Down
2 changes: 1 addition & 1 deletion tests/S3SignatureV4Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testPresign()
];

$expires = strtotime(date(self::ISO8601)) + $expiresTime;
$expires = date(self::ISO8601, $expires);
$expires = gmdate(self::ISO8601, $expires);

$sing = new S3SignatureV4();

Expand Down

0 comments on commit 3537c57

Please sign in to comment.