diff options
author | Greg Wilkins | 2014-11-05 00:12:17 +0000 |
---|---|---|
committer | Greg Wilkins | 2014-11-05 00:12:17 +0000 |
commit | 4cb8e7f64447851215f03b63692e5d5613e3f945 (patch) | |
tree | 6926711c55096cba4f6fbdea2e77d74218a03d79 | |
parent | 3164243fb8c6ec5d370ed8b7914026d6cd97ce40 (diff) | |
download | org.eclipse.jetty.project-4cb8e7f64447851215f03b63692e5d5613e3f945.tar.gz org.eclipse.jetty.project-4cb8e7f64447851215f03b63692e5d5613e3f945.tar.xz org.eclipse.jetty.project-4cb8e7f64447851215f03b63692e5d5613e3f945.zip |
449811 handle unquoted etags when gzipping
-rw-r--r-- | jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHttpOutputInterceptor.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHttpOutputInterceptor.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHttpOutputInterceptor.java index e4eb3c7e04..451916c535 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHttpOutputInterceptor.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHttpOutputInterceptor.java @@ -204,8 +204,13 @@ public class GzipHttpOutputInterceptor implements HttpOutput.Interceptor _channel.getResponse().setContentLength(-1); String etag=fields.get(HttpHeader.ETAG); if (etag!=null) - fields.put(HttpHeader.ETAG,etag.substring(0,etag.length()-1)+GzipHandler.ETAG_GZIP+ '"'); - + { + int end = etag.length()-1; + etag=(etag.charAt(end)=='"')?etag.substring(0,end)+GzipHandler.ETAG_GZIP+'"':etag+GzipHandler.ETAG_GZIP; + fields.put(HttpHeader.ETAG,etag); + } + + LOG.debug("{} compressing {}",this,_deflater); _state.set(GZState.COMPRESSING); |