Add pagination to search endpoints by alaycock · Pull Request #583 · github-tools/github
If someone can clarify this, I would appreciate it.
Why does the page number need to be manually extracted and appended to the options?
nextUrl is being extracted from the headers, wouldn't it have all the options it already needs? Then by calling this._requestAllPages(nextUrl, options, cb, results); the options are being re-added to the url, which results in duplicate parameters in the path, eg:
/search/repositories?q=tetris+language%3Aassembly&sort=stars&order=desc&type=all&per_page=100&page=4&q=tetris+language:assembly&sort=stars&order=desc&type=all&per_page=100&page=4
Although this might just be a workaround for other endpoints, since I have't done exploration into how other endpoints paginate.