Closed
Description
What version of Go are you using (go version
)?
$ go version go version devel +0e015e20cf Wed Sep 11 12:26:35 2019 +0000 linux/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env
)?
Not relevant
What did you do?
https://play.golang.org/p/gtm6ZUm4omF
h := http.Header{}
exclude := map[string]bool{}
for k, v := range headers {
h.Add(k, v)
exclude[k] = true
}
h.WriteSubset(os.Stdout, exclude)
What did you expect to see?
Nothing
What did you see instead?
All lowercase headers
Notes
I think this should either be documented or fixed as WriteSubset is the only method for http.Header that does not perform canonicalization.
/cc @bradfitz @rsc as per https://dev.golang.org/owners
/cc @kele as we found this together