aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/httputil
diff options
context:
space:
mode:
authorJes Cok <xigua67damn@gmail.com>2023-07-25 23:10:34 +0000
committerGopher Robot <gobot@golang.org>2023-07-27 22:07:13 +0000
commit3bc28402fae2a1646e4d2756344b5eb34994d25f (patch)
treea7b1cb6fe83f489e038e9a11204eb0b9795ee802 /src/net/http/httputil
parent1c10d743eaff174f08e48dff85f64ade0b92425c (diff)
downloadgo-3bc28402fae2a1646e4d2756344b5eb34994d25f.tar.xz
all: use built-in clear to clear maps
Change-Id: I7f4ac72fe3230d8b7486fab0c925015cefcbe355 GitHub-Last-Rev: 54455839b674f980fb6c3afceb433db4833d340e GitHub-Pull-Request: golang/go#61544 Reviewed-on: https://go-review.googlesource.com/c/go/+/512376 Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/net/http/httputil')
-rw-r--r--src/net/http/httputil/reverseproxy.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/net/http/httputil/reverseproxy.go b/src/net/http/httputil/reverseproxy.go
index 2a76b0b8dc..719ab62d1a 100644
--- a/src/net/http/httputil/reverseproxy.go
+++ b/src/net/http/httputil/reverseproxy.go
@@ -461,10 +461,7 @@ func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
rw.WriteHeader(code)
// Clear headers, it's not automatically done by ResponseWriter.WriteHeader() for 1xx responses
- for k := range h {
- delete(h, k)
- }
-
+ clear(h)
return nil
},
}