8000 Fix authorization for GET methods with params · redaxeprogrammers/codebird-php@b6af091 · GitHub
[go: up one dir, main page]

Skip to content

Commit b6af091

Browse files
committed
Fix authorization for GET methods with params
1 parent ce00944 commit b6af091

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/codebird.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,14 +1213,14 @@ protected function _callApiCurl($httpmethod, $method, $params = array(), $multip
12131213
$url = $this->_getEndpoint($method);
12141214
$request_headers = array();
12151215
if ($httpmethod === 'GET') {
1216+
if (! $app_only_auth) {
1217+
$authorization = $this->_sign($httpmethod, $url, $params);
1218+
}
12161219
if (json_encode($params) !== '{}'
12171220
&& json_encode($params) !== '[]'
12181221
) {
12191222
$url .= '?' . http_build_query($params);
12201223
}
1221-
if (! $app_only_auth) {
1222-
$authorization = $this->_sign($httpmethod, $url, $params);
1223-
}
12241224
$ch = curl_init($url);
12251225
} else {
12261226
if ($multipart) {
@@ -1324,14 +1324,14 @@ protected function _callApiNoCurl($httpmethod, $method, $params = array(), $mult
13241324
$hostname = parse_url($url, PHP_URL_HOST);
13251325
$request_headers = array();
13261326
if ($httpmethod === 'GET') {
1327+
if (! $app_only_auth) {
1328+
$authorization = $this->_sign($httpmethod, $url, $params);
1329+
}
13271330
if (json_encode($params) !== '{}'
13281331
&& json_encode($params) !== '[]'
13291332
) {
13301333
$url .= '?' . http_build_query($params);
13311334
}
1332-
if (! $app_only_auth) {
1333-
$authorization = $this->_sign($httpmethod, $url, $params);
1334-
}
13351335
} else {
13361336
if ($multipart) {
13371337
if (! $app_only_auth) {

0 commit comments

Comments
 (0)
0