-
Notifications
You must be signed in to change notification settings - Fork 129
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
Vary: Accept-encoding header is duplicated if inner handler sets it #90
Comments
I'm not sure there's a great way to fix this because technically the // if something else already set Vary: Accept-Encoding, don't set it twice
if !strings.Contains(w.Header().Get(vary), acceptEncoding) {
w.Header().Add(vary, acceptEncoding)
} |
Get() only returns the first element of a slice. Have to iterate over the slice. Also use canonical values.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If the inner HTTP handler sets a
Vary: Accept-Encoding
header, then as the gzip middleware will always add in the same header, the output will have two identical headers.Here is a failing test case:
I don't think the HTTP spec explicitly disallows you from having the same key/value appearing twice in the headers but it feels tidier to only have one instance of it.
The text was updated successfully, but these errors were encountered: