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

Setting Host header in outgoing request, closes #3792 #3796

Merged
merged 1 commit into from
Mar 16, 2016
Merged

Conversation

oxtoacart
Copy link
Contributor

No description provided.

@@ -35,6 +35,9 @@ func (client *Client) newReverseProxy(bal *balancer.Balancer) *httputil.ReverseP
// field when upstream servers are trying to determine the client IP.
// We need to add also the X-Lantern-Device-Id field.
Director: func(req *http.Request) {
// Add back the Host header which was stripped by the ReverseProxy. This
// is needed for sites that do virtual hosting.
req.Header.Set("Host", req.Host)
Copy link
Contributor

Choose a reason for hiding this comment

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

It's definitely stripped before our Director function is called right @oxtoacart?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's stripped by the http.Server, which is using the ReverseProxy as a Handler, so by the time it gets to the ReverseProxy's logic, the header is already gone.

@myleshorton
Copy link
Contributor

LGTM.

myleshorton added a commit that referenced this pull request Mar 16, 2016
Setting Host header in outgoing request, closes #3792
@myleshorton myleshorton merged commit fd97e0e into master Mar 16, 2016
@myleshorton myleshorton deleted the issue3792 branch March 16, 2016 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants