net/mail: not clear that Header.Get is case insensitive #18019
Labels
Documentation
Issues describing a change to documentation.
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
Reading the godoc:
It's not immediately obvious that
key
is not case sensitive. As it turns out,Get("From")
andGet("from")
mean the same because internally this all goes through https://golang.org/pkg/net/textproto/#CanonicalMIMEHeaderKey.Perhaps this is just me not being used to MIME Headers being canonical in this way. But I think a sentence like "note that key is case insensitive as it is canonicalized" would help some people. The
net/mail
godoc does not mention MIME headers anywhere either.Perhaps this should go in
net/textproto
too, even though that's much closer to the actualCanonicalMIMEHeaderKey
func.The text was updated successfully, but these errors were encountered: