Skip to content

Commit ae8bd7c

Browse files
Auth(Auth): add ? to $path instead of $query
- if there is no json payload, use '{}' instead of empty string.
1 parent 3181114 commit ae8bd7c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Auth/Auth.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ public function setAuthorization($options, $signKey, $clientId)
4141
$headers['clientid'] = $clientId;
4242
$headers['timestamp'] = $this->Auth_util->dateNow();
4343
$parsedUrl = parse_url(isset($opts['uri']) ? $opts['uri'] : '');
44-
$query = isset($parsedUrl['query']) ? '?' . $parsedUrl['query'] : '';
45-
$path = $query ? $parsedUrl['path'] . $query : $parsedUrl['path'];
44+
$query = isset($parsedUrl['query']) ? $parsedUrl['query'] : '';
45+
$path = $query ? $parsedUrl['path'] . '?' . $query : $parsedUrl['path'];
4646

4747
$headers['authorization'] = $this->Auth_util->generateHash([
4848
'clientId' => $clientId,
4949
'path' => $path ? $path : '',
5050
'qs' => $query ? $query : '',
51-
'body' => isset($opts['json']) ? json_encode($opts['json'], JSON_UNESCAPED_SLASHES) : '',
51+
'body' => isset($opts['json']) ? json_encode($opts['json'], JSON_UNESCAPED_SLASHES) : '{}',
5252
'nonce' => $headers['nonce'],
5353
'timestamp' => $headers['timestamp']
5454
], $signKey);

0 commit comments

Comments
 (0)