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

Prevent adding Accept header when already one. #81

Merged
merged 1 commit into from
Dec 16, 2022

Conversation

Eclion
Copy link
Contributor

@Eclion Eclion commented Nov 3, 2022

This change prevents the Accept header application/vnd.github.v3+json from being added to the headers in case there is already an Accept header.

The mentioned header is necessary for most interactions with the GitHub API, but it also influence the behaviour of some resource call in an unexpected way.

Example:
When downloading a release with the go-github library, an Accept header application/octet-stream is added by the latter, then ghinstallation adds the Accept header application/vnd.github.v3+json.
The response to such request isn't the content of the release, as one could expect when using the function DownloadReleaseAsset but a json describing the release.

This PR prevents this behaviour from happening and tackle the issue #12

Copy link
Collaborator

@wlynch wlynch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@wlynch wlynch merged commit 185b910 into bradleyfalzon:master Dec 16, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants