Skip to content

Commit 09e76f3

Browse files
Allow complete URL in get method
The get method always prepends the baseurl before the requests path. A check was added to allow for full URLS (starting with baseurl), for following pagination links.
1 parent 8bedcf3 commit 09e76f3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Github/HttpClient/HttpClient.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ public function put($path, array $parameters = array(), array $headers = array()
163163
*/
164164
public function request($path, array $parameters = array(), $httpMethod = 'GET', array $headers = array())
165165
{
166-
$path = trim($this->options['base_url'].$path, '/');
166+
if (0 !== strpos( $path, $this->options['base_url'] )) {
167+
$path = trim($this->options['base_url'].$path, '/');
168+
}
167169

168170
$request = $this->createRequest($httpMethod, $path);
169171
$request->addHeaders($headers);

0 commit comments

Comments
 (0)