Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot specify preview API accept header with non-json type #924

Closed
haya14busa opened this issue Jun 5, 2018 · 1 comment
Closed

Cannot specify preview API accept header with non-json type #924

haya14busa opened this issue Jun 5, 2018 · 1 comment

Comments

@haya14busa
Copy link
Contributor

haya14busa commented Jun 5, 2018

For example, GitHub apps API need preview accept header application/vnd.github.machine-man-preview+json
https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/

If the GitHub apps need to access non-json type endpoint such as getting diff of PullRequest, need to set
application/vnd.github.machine-man-preview.diff
as documented in https://developer.github.com/v3/media/#diff. (application/vnd.github.VERSION.diff)

However, go-github always set application/vnd.github.v3.diff for PullRequests.GetRaw request, so the request to GitHub will fail with 403 Resource not accessible by integration error.

I confirmed it works if i use application/vnd.github.machine-man-preview.diff accept header.

Note that it doesn't work only for private repository and as for public repo, it works with application/vnd.github.v3.diff header.

@haya14busa
Copy link
Contributor Author

Sorry, i thought i confirmed it works but it actually not. maybe GitHub problem...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant