Skip to content

Commit

Permalink
Merge pull request getlantern#3796 from getlantern/issue3792
Browse files Browse the repository at this point in the history
Setting Host header in outgoing request, closes #3792
  • Loading branch information
myleshorton committed Mar 16, 2016
2 parents 20cd17e + 89624a6 commit fd97e0e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/github.com/getlantern/flashlight/client/reverseproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
req.Header.Set("X-LANTERN-DEVICE-ID", client.cfg().DeviceID)
for _, authToken := range allAuthTokens {
req.Header.Add("X-LANTERN-AUTH-TOKEN", authToken)
Expand Down

0 comments on commit fd97e0e

Please sign in to comment.