]> Cypherpunks repositories - gostls13.git/commit
net/http/httputil: copy header map if necessary in ReverseProxy
authorSina Siadat <siadat@gmail.com>
Sun, 4 Sep 2016 07:50:14 +0000 (12:20 +0430)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 8 Sep 2016 04:37:36 +0000 (04:37 +0000)
commit24d8f3fa4b02784af2419eec8a28aee303aae0c5
tree89c817b910d562bd416c70cc5345bfe50689c51d
parentb6f44923c0f88eb36816d90fb8fff2fd78422df5
net/http/httputil: copy header map if necessary in ReverseProxy

We were already making a copy of the map before removing
hop-by-hop headers. This commit does the same for proxied
headers mentioned in the "Connection" header.

A test is added to ensure request headers are not modified.

Updates #16875

Change-Id: I85329d212787958d5ad818915eb0538580a4653a
Reviewed-on: https://go-review.googlesource.com/28493
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
src/net/http/httputil/reverseproxy.go
src/net/http/httputil/reverseproxy_test.go