-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
feat: Promote "Host" header if present. Fixes #12690 #12691
base: main
Are you sure you want to change the base?
Conversation
Promotes any `Host` header to the `http.Request.Host` field. Relates to golang/go#29865 Signed-off-by: Phil Brown <pbrown2@atlassian.com>
What was your intent for this -- did you mean to modify the CLI? Because the It may make sense to limit this change to only the CLI if that was your intent |
@agilgur5 the intent was for the CLI. I didn't see anywhere else where this could possibly be done though. The request construction is completely opaque outside the Facade |
Trim whitespace from any detected "Host" header value Signed-off-by: Phil Brown <pbrown2@atlassian.com>
Unit test failure doesn't seem related and I cannot reproduce it locally. Counting files in |
FYI we're using my fork and it's working great for us. It would be fantastic if this could be incorporated into the official release |
Fixes #12690
Motivation
When communicating with a proxy or load balancer that does not do Host header rewriting, it may be required to override the default request Host header.
Go's HTTP request does not do this by default when passed a Host header value.
Modifications
Checks for any
Host
header in the HTTPFacade
and promotes it to the requestHost
field if found.Verification
This is a very simple change and since there were no existing headers tests, it didn't seem necessary.