]> Cypherpunks repositories - gostls13.git/commit
net/http/httputil: add X-Forwarded-{Host,Proto} headers in ReverseProxy
authorDamien Neil <dneil@google.com>
Thu, 19 May 2022 20:20:21 +0000 (13:20 -0700)
committerDamien Neil <dneil@google.com>
Fri, 12 Aug 2022 16:38:28 +0000 (16:38 +0000)
commit1513e57b704056b794f0706362fa3c949f2972a4
tree562c8d6053ca009a4705f3564b3023e8f2292129
parent2cf49a76b674ee5075f3ed6ff857c5b3e7a8109a
net/http/httputil: add X-Forwarded-{Host,Proto} headers in ReverseProxy

X-Forwarded-Host contains the original request's host.

X-Forwarded-Proto contains "http" or "https", depending on whether the
original request was made on a TLS-secured connection.

Setting either header to nil in Director disables adding the header,
same as for X-Forwarded-For.

Fixes #50465.

Change-Id: If8ed1f48d83f8ea0389c53519bc7994cb53891db
Reviewed-on: https://go-review.googlesource.com/c/go/+/407414
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Damien Neil <dneil@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/http/httputil/reverseproxy.go
src/net/http/httputil/reverseproxy_test.go