Update "Accept" header for github.com requests#3803
Merged
Conversation
The `antiope-preview` has graduated in github.com and no longer needs activating. However, we still need it for GHES requests.
samcoe
approved these changes
Jun 8, 2021
Contributor
samcoe
left a comment
There was a problem hiding this comment.
Awesome, thanks for adding these tests! I left one small non-blocking comment.
pkg/cmd/factory/http_test.go
Outdated
| }, | ||
| host: "github.com", | ||
| wantHeader: map[string]string{ | ||
| "authorization": "", |
Contributor
There was a problem hiding this comment.
I found this test just a tad confusing in that it made it seem like the Accept argument also controlled if the authorization header was set when it is just not set due to the config not having authorization information for github.com. It might be a bit less confusing if we added two tests specifically for the authorization header (one where there is config auth token value for host and one without).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
antiope-previewhas graduated in github.com and no longer needs activating. However, we still need it for GHES requests.Bonus: this adds tests for our base HTTP client that handles all requests and adds headers like
User-Agent,Authorization, andAccept.