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
Set blank headers so they are not automatically resolved by go-gh #5935
Conversation
I've got a problem today where I can no longer pass an alternative Am I right in thinking this PR would resolve that? |
This comment was marked as spam.
This comment was marked as spam.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed that this fixes things for me; thank you! In the future, I propose that we make this more declarative; i.e. that we don't have to explicitly set headers to blank strings just so that they can be set to a correct value later. But I guess that might require a change to go-gh behavior?
authorization: "", | ||
contentType: "", | ||
timeZone: "", | ||
userAgent: "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The semantics for passing a blank string to get the desired (non-blank) result in the end is confusing to me; would there be a way to make this clearer as follow-up?
@mislav I agree it is confusing. I have a few ideas on what we could do in |
This PR fixes two bugs dealing with the handling of headers for http requests.
api.Client
will now properly send the "User-Agent" header instead of having it overwritten bygo-gh
.api
command can pass an alternativeAuthorization
header.