1
0
mirror of https://github.com/golang/go synced 2024-11-18 09:14:43 -07:00

minor simplification

This commit is contained in:
Kévin Dunglas 2022-07-12 09:30:22 +02:00
parent c3d0e2a1da
commit 56dd718358
No known key found for this signature in database
GPG Key ID: 4D04EBEF06AAF3A6

View File

@ -460,7 +460,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 {
for k := range h {
delete(h, k)
}
@ -489,6 +489,7 @@ func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
if !p.modifyResponse(rw, res, outreq) {
return
}
copyHeader(rw.Header(), res.Header)
// The "Trailer" header isn't included in the Transport's response,