Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove CanonicalMIMEHeaderKey() #19

Open
washanhanzi opened this issue Nov 24, 2023 · 0 comments
Open

Remove CanonicalMIMEHeaderKey() #19

washanhanzi opened this issue Nov 24, 2023 · 0 comments

Comments

@washanhanzi
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant