@@ -11,9 +11,10 @@ public function __construct($accessKey, $secretKey) {
1111 public function __destruct () {
1212 }
1313 public function signRequest (RequestInterface $ request ) {
14+ $ host = $ request ->getHeader ('Host ' );
1415 $ signTime = (string )(time () - 60 ) . '; ' . (string )(time () + 3600 );
1516 $ httpString = strtolower ($ request ->getMethod ()) . "\n" . urldecode ($ request ->getPath ()) .
16- "\n\nhost= " . $ request -> getHost () . "\n" ;
17+ "\n\nhost= " . $ host . "\n" ;
1718 $ sha1edHttpString = sha1 ($ httpString );
1819 $ stringToSign = "sha1 \n$ signTime \n$ sha1edHttpString \n" ;
1920 $ signKey = hash_hmac ('sha1 ' , $ signTime , $ this ->secretKey );
@@ -27,9 +28,10 @@ public function createAuthorization(
2728 RequestInterface $ request ,
2829 $ expires = "10 minutes "
2930 ) {
31+ $ host = $ request ->getHeader ('Host ' );
3032 $ signTime = (string )(time () - 60 ) . '; ' . (string )(strtotime ($ expires ));
3133 $ httpString = strtolower ($ request ->getMethod ()) . "\n" . urldecode ($ request ->getPath ()) .
32- "\n\nhost= " . $ request -> getHost () . "\n" ;
34+ "\n\nhost= " . $ host . "\n" ;
3335 $ sha1edHttpString = sha1 ($ httpString );
3436 $ stringToSign = "sha1 \n$ signTime \n$ sha1edHttpString \n" ;
3537 $ signKey = hash_hmac ('sha1 ' , $ signTime , $ this ->secretKey );
0 commit comments