From a570fcf74bdf652f453ed5dc0d8a41b15f1af8de Mon Sep 17 00:00:00 2001 From: empijei Date: Wed, 16 Oct 2019 06:56:10 +0200 Subject: [PATCH] net/http: clarify Header.WriteSubset behavior 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 --- src/net/http/header.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/net/http/header.go b/src/net/http/header.go index 4a4ebbcf2f878..b9b53911f3844 100644 --- a/src/net/http/header.go +++ b/src/net/http/header.go @@ -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) }