echo-jwt icon indicating copy to clipboard operation
echo-jwt copied to clipboard

Remove CanonicalMIMEHeaderKey()

Open washanhanzi opened this issue 1 year ago • 0 comments

I think we can remove this line: https://github.com/labstack/echo-jwt/blob/2fe4a09e5ba3530b701397c0f42d5003958def3f/extractors.go#L98

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

washanhanzi avatar Nov 24 '23 11:11 washanhanzi