Paginate does not pass through custom accept headers
See original GitHub issueBug Report
Current Behavior
When setting a custom Accept
header, the paginate
function does not use the value in any request but the first.
octokit.paginate(
octokit.apps.getInstallationRepositories({
per_page: 100,
headers: {
accept: 'application/vnd.github.machine-man-preview+json,application/vnd.github.mercy-preview+json'
}
}),
(res) => res.data.repositories
)
Expected behavior/code
Every request that paginate
makes uses the custom headers defined.
Environment
- Probot version(s): 7.2.0
- Node/npm version: Node 10.13.0
- OS: macOS
Related Octokit / Probot links
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Using pagination in the REST API - GitHub Docs
When a response is paginated, the response headers will include a link header. The link header will be omitted if the endpoint does...
Read more >http - Paging in a Rest Collection - Stack Overflow
To request a specific part of a collection, the client MUST use the "Range" header, and fill the "If-Match" header with the ETag...
Read more >How to pass Pagination rules during a rest api calls in copy ...
For the authorization, that should be placed under the "additional headers" section, not the "pagination" section. You do not expect new bearer ...
Read more >REST API paging via headers
There are several possible negatives when considering custom header fields. Browser based testing will be difficult; Proxies sometimes ...
Read more >February 10: Pagination in a json-server API with the link header
The link header is a string — not an array or object — and you'll have to parse it to an Object do...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes we do that via #744 but we keep the old one around and log a deprecation warning to make it easier for folks to upgrade
That should work as expected with Probot 9, note that the API changed. The old API is still working, but logs a deprecation message