I think we can remove this line:
|
header = textproto.CanonicalMIMEHeaderKey(header) |
The net/http/header.go already convert this for us:
// Values returns all values associated with the given key.
// It is case insensitive; textproto.CanonicalMIMEHeaderKey is
// used to canonicalize the provided key. To use non-canonical
// keys, access the map directly.
// The returned slice is not a copy.
func (h Header) Values(key string) []string {
return textproto.MIMEHeader(h).Values(key)
}
https://pkg.go.dev/net/http#Header.Values