Skip to content

Commit

Permalink
condense loop logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathonlacher committed May 14, 2019
1 parent 9c70906 commit b410381
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/net/http/httputil/reverseproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,10 @@ func shouldPanicOnCopyError(req *http.Request) bool {
// removeConnectionHeaders removes hop-by-hop headers listed in the "Connection" header of h.
// See RFC 7230, section 6.1
func removeConnectionHeaders(h http.Header) {
if c := h["Connection"]; len(c) > 0 {
for _, f := range c {
for _, sf := range strings.Split(f, ",") {
if sf = strings.TrimSpace(sf); sf != "" {
h.Del(sf)
}
for _, f := range h["Connection"] {
for _, sf := range strings.Split(f, ",") {
if sf = strings.TrimSpace(sf); sf != "" {
h.Del(sf)
}
}
}
Expand Down

0 comments on commit b410381

Please sign in to comment.