Skip to content

Commit

Permalink
minor simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Aug 30, 2022
1 parent c3d0e2a commit 56dd718
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/net/http/httputil/reverseproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 56dd718

Please sign in to comment.