-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Description
In transport/http/server.go i have found 2 places where the headers are not correctly set to all values the http.Header might be holding.
http.Header is a map[string][]string and .Get(k) only returns the first of those fields from the []string array. I think to correctly handle it, we should do as the docs suggest:
// Get gets the first value associated with the given key.
// It is case insensitive; textproto.CanonicalMIMEHeaderKey is used
// to canonicalize the provided key.
// If there are no values associated with the key, Get returns "".
// To access multiple values of a key, or to use non-canonical keys,
// access the map directly.
func (h Header) Get(key string) string {
return textproto.MIMEHeader(h).Get(key)
}
which would be sthg along the lines ...
for k,hdrs := range headerer.Headers() {
for _,h := range hdrs {
w.Header().Add(k, h))
}
}
Line 148 in 1b4cf21
| w.Header().Set(k, headerer.Headers().Get(k)) |
Reactions are currently unavailable