Closed dtomcej closed 3 years ago
Just hit into this problem while combining nytimes/gziphandler
with lpar/gzipped
(that also sets the Vary
header). Thanks for the fix and hopefully gets merged soon!
In my case I'm getting duplicate Vary
headers with the same value:
Vary: Accept-Encoding
Vary: Accept-Encoding
Any ETA when this going to be merged?
There isn’t any big here as it’s perfectly valid to include multiple Vary headers in a response. HTTP provides well defined merge semantics for headers: Vary: a
& Vary: b
being exactly equivalent to Vary: a, b
.
While it is a tad unfortunate to include duplicates, that’s also not a bug and could be filtered out by a higher level wrapper if you really didn’t like having duplicates.
I understand containous/traefik includes code the same as this PR. That code has the same bugs as this PR and should be removed or replaced.
This PR:
Vary
header has already been set for the response.This allows this handler to be used in chains where upstream links may set the Vary header on the response before it is returned to this handler.