Skip to content

Commit

Permalink
net/http: clarify Header.WriteSubset behavior
Browse files Browse the repository at this point in the history
The current implementation performs a plain map lookup,
but other header methods canonicalize header keys before
using them.

Fixes #34918

Change-Id: Id4120488b8b39ecee97fa7a6ad8a34158687ffcd
Reviewed-on: https://go-review.googlesource.com/c/go/+/201357
Reviewed-by: Brad Fitzpatrick <[email protected]>
  • Loading branch information
empijei authored and bradfitz committed Nov 1, 2019
1 parent 8405cd3 commit a570fcf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/net/http/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ func (h Header) sortedKeyValues(exclude map[string]bool) (kvs []keyValues, hs *h

// WriteSubset writes a header in wire format.
// If exclude is not nil, keys where exclude[key] == true are not written.
// Keys are not canonicalized before checking the exclude map.
func (h Header) WriteSubset(w io.Writer, exclude map[string]bool) error {
return h.writeSubset(w, exclude, nil)
}
Expand Down

0 comments on commit a570fcf

Please sign in to comment.