The existing documentation is unclear about header keys formatting.
The clarifying sentence is added to Get function to emphasis that
keys have to be stored in canonical format to have Get returining
non empty value.
Fixes #53140
Change-Id: Icd0955bcbb6676cec028fe37042aed5846e13ed1
Reviewed-on: https://go-review.googlesource.com/c/go/+/417975
Run-TryBot: Damien Neil <dneil@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
// Get gets the first value associated with the given key. If
// there are no values associated with the key, Get returns "".
// It is case insensitive; textproto.CanonicalMIMEHeaderKey is
-// used to canonicalize the provided key. To use non-canonical keys,
+// used to canonicalize the provided key. Get assumes that all
+// keys are stored in canonical form. To use non-canonical keys,
// access the map directly.
func (h Header) Get(key string) string {
return textproto.MIMEHeader(h).Get(key)