Skip to content

Commit b38d803

Browse files
committed
Authentication with AUTH_URL_TOKEN bug fix
If user authenticates with AUTH_URL_TOKEN and request parameter are not empty access_token must be appended by `&` (and not `?`)
1 parent 0a14df1 commit b38d803

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Github/HttpClient/Listener/AuthListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function preSend(RequestInterface $request)
8686
}
8787

8888
$url = $request->getUrl();
89-
$url .= '?'.utf8_encode(http_build_query(array('access_token' => $this->options['tokenOrLogin']), '', '&'));
89+
$url .= (false === strpos($url, '?') ? '?' : '&').utf8_encode(http_build_query(array('access_token' => $this->options['tokenOrLogin']), '', '&'));
9090

9191
$request->fromUrl(new Url($url));
9292
break;

0 commit comments

Comments
 (0)