]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: clarify Header.WriteSubset behavior
authorempijei <robclap8@gmail.com>
Wed, 16 Oct 2019 04:56:10 +0000 (06:56 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 1 Nov 2019 14:48:28 +0000 (14:48 +0000)
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 <bradfitz@golang.org>
src/net/http/header.go

index 4a4ebbcf2f8782d495ccd58a3901efbf186c911d..b9b53911f384410425323e30efe391f9bfa02c78 100644 (file)
@@ -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)
 }