381521 set Vary:Accept-Encoding header for compressed content
This commit is contained in:
parent
3e5eff3719
commit
66d171f7d0
|
@ -235,6 +235,7 @@ public abstract class AbstractCompressedStream extends ServletOutputStream
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
|
|
||||||
setHeader("Content-Encoding", _encoding);
|
setHeader("Content-Encoding", _encoding);
|
||||||
|
setHeader("Vary","Accept-Encoding");
|
||||||
|
|
||||||
if (_response.containsHeader("Content-Encoding"))
|
if (_response.containsHeader("Content-Encoding"))
|
||||||
{
|
{
|
||||||
|
|
|
@ -497,6 +497,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
|
||||||
if (gzip)
|
if (gzip)
|
||||||
{
|
{
|
||||||
response.setHeader(HttpHeaders.CONTENT_ENCODING,"gzip");
|
response.setHeader(HttpHeaders.CONTENT_ENCODING,"gzip");
|
||||||
|
response.setHeader(HttpHeaders.VARY,HttpHeaders.ACCEPT_ENCODING);
|
||||||
String mt=_servletContext.getMimeType(pathInContext);
|
String mt=_servletContext.getMimeType(pathInContext);
|
||||||
if (mt!=null)
|
if (mt!=null)
|
||||||
response.setContentType(mt);
|
response.setContentType(mt);
|
||||||
|
|
Loading…
Reference in New Issue