When using the example compression filter, set the Vary header on compressed responses
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@962889
13f79535-47bb-0310-9956-
ffa450edef68
naming resources that broke the complete server status page in the
manager application. Note these MBeans now have a new name. (markt)
</fix>
+ <fix>
+ <bug>49570</bug>: When using the example compression filter, set the
+ Vary header on compressed responses. (markt)
+ </fix>
</changelog>
</subsection>
</section>
gzipstream = output;
} else {
response.addHeader("Content-Encoding", "gzip");
+ String vary = response.getHeader("Vary");
+ if (vary == null) {
+ // Add a new Vary header
+ response.setHeader("Vary", "Accept-Encoding");
+ } else if (vary.equals("*")) {
+ // No action required
+ } else {
+ // Merge into current header
+ response.setHeader("Vary", vary + ",Accept-Encoding");
+ }
gzipstream = new GZIPOutputStream(output);
}
}