peter-murach/github — pull request #90 by boyan (2013-02-13 14:24:36+00:00)
Title: Enable page navigation for GitHub Enterprise

@peter-murach this is far from ready, but I wanted to first ask you a couple of questions. Issue #45 is now back on my radar as we have more than 100 issues in a repo and need to access more than one page of results.

From [this line](https://github.com/peter-murach/github/blob/master/lib/github_api/page_iterator.rb#L60), a URI and hash of params go to `Request::request`, which seems to expect a _path_ instead of a full URI as its first parameter.

Next, I observed that [this is the line](https://github.com/peter-murach/github/blob/master/lib/github_api/request.rb#L39) resulting in `https:///api/v3https://api/v3/repos/GitHub/issues-dev/issues?access_token=&page=2&per_page=100`.

```ruby
path = (conn.path_prefix + path).gsub(/\/\//,'/') if conn.path_prefix != '/'
```

I'm uncertain about when you'd ever have two slashes in the path prefix (I have yet to read up on [Faraday](https://github.com/lostisland/faraday) to understand the use of `path_prefix` better). This line seems to only get executed for GH Enterprise, where `path_prefix == '/api/v3'`.

Passing paths only instead of URIs to `page_request` in `PageIterator` seems to fix the issue for me, and not break issue pagination for non-Enterprise GitHub. My guess is that we should do that for all such occurrences in `PageIterator`, but wanted to make sure that this is what we want because there are test cases specifically verifying that URIs are passed. Let me know if I am missing something in my understanding.

Thanks,
Boyan