Skip to content

Commit dc10d86

Browse files
authored
Merge pull request #661 from naderman/fix-ghe-pager
Fix GitHub Enterprise API Pagination: do not prepend api/vX/ to the path if it already starts that way
2 parents ba01b38 + c49e378 commit dc10d86

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Github/HttpClient/Plugin/PathPrepend.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ public function __construct($path)
2828
public function handleRequest(RequestInterface $request, callable $next, callable $first)
2929
{
3030
$currentPath = $request->getUri()->getPath();
31-
$uri = $request->getUri()->withPath($this->path.$currentPath);
31+
if (strpos($currentPath, $this->path) !== 0) {
32+
$uri = $request->getUri()->withPath($this->path.$currentPath);
33+
}
3234

3335
$request = $request->withUri($uri);
3436

0 commit comments

Comments
 (0)