]> Cypherpunks repositories - gostls13.git/commit
net/http: preserve Host header following a relative redirect
authorTom Bergan <tombergan@google.com>
Fri, 13 Oct 2017 22:56:37 +0000 (15:56 -0700)
committerTom Bergan <tombergan@google.com>
Mon, 16 Oct 2017 17:44:26 +0000 (17:44 +0000)
commit47f4e7a9768a613371ccd4a94a6b325fd603727e
tree67050fdec3846f46d054c6c3c71b6da6c73e06ed
parent645c661a54e35cf0e4ee7fb480b00a4b4d2b1ba0
net/http: preserve Host header following a relative redirect

If the client sends a request with a custom Host header and receives
a relative redirect in response, the second request should use the
same Host header as the first request. However, if the response is
an abolute redirect, the Host header should not be preserved. See
further discussion on the issue tracker.

Fixes #22233

Change-Id: I8796e2fbc1c89b3445e651f739d5d0c82e727c14
Reviewed-on: https://go-review.googlesource.com/70792
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/net/http/client.go
src/net/http/client_test.go