Skip to content

Commit 953504c

Browse files
committed
Explicitly set http_build_query arg separator and add milliseconds to Timestamp
Fixes #4 - thanks @vladaman!
1 parent 682fe54 commit 953504c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/AmazonSNS.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ private function _request($action, $params = array()) {
432432
// Add in required params
433433
$params['Action'] = $action;
434434
$params['AWSAccessKeyId'] = $this->access_key;
435-
$params['Timestamp'] = gmdate('Y-m-d\TH:i:s\Z');
435+
$params['Timestamp'] = gmdate('Y-m-d\TH:i:s.000\Z');
436436
$params['SignatureVersion'] = 2;
437437
$params['SignatureMethod'] = 'HmacSHA256';
438438

@@ -456,7 +456,7 @@ private function _request($action, $params = array()) {
456456
);
457457

458458
// Finally create request
459-
$request = $this->protocol . $this->endpoint . '/?' . http_build_query($params);
459+
$request = $this->protocol . $this->endpoint . '/?' . http_build_query($params, '', '&');
460460

461461
// Instantiate cUrl and perform request
462462
$ch = curl_init();

0 commit comments

Comments
 (0)