diff options
author | Greg Wilkins | 2015-09-18 02:30:02 +0000 |
---|---|---|
committer | Greg Wilkins | 2015-09-18 02:30:02 +0000 |
commit | 99f4ed7352504072753e14615fe0e3471a00824b (patch) | |
tree | 03d60adef1959bbfee2254675a22044fee0a6a14 /jetty-http | |
parent | d39677a6359e9e768b35cff7957227ea14b8bb7a (diff) | |
download | org.eclipse.jetty.project-99f4ed7352504072753e14615fe0e3471a00824b.tar.gz org.eclipse.jetty.project-99f4ed7352504072753e14615fe0e3471a00824b.tar.xz org.eclipse.jetty.project-99f4ed7352504072753e14615fe0e3471a00824b.zip |
477737 Improve handling of etags with dynamic and static gzip
Diffstat (limited to 'jetty-http')
-rw-r--r-- | jetty-http/src/main/java/org/eclipse/jetty/http/GzipHttpContent.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/GzipHttpContent.java b/jetty-http/src/main/java/org/eclipse/jetty/http/GzipHttpContent.java index ff70f3777f..1354358def 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/GzipHttpContent.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/GzipHttpContent.java @@ -32,8 +32,19 @@ public class GzipHttpContent implements HttpContent private final HttpContent _content; private final HttpContent _contentGz; public final static String ETAG_GZIP="--gzip"; + public final static String ETAG_GZIP_QUOTE="--gzip\""; public final static PreEncodedHttpField CONTENT_ENCODING_GZIP=new PreEncodedHttpField(HttpHeader.CONTENT_ENCODING,"gzip"); + public static String removeGzipFromETag(String etag) + { + if (etag==null) + return null; + int i = etag.indexOf(ETAG_GZIP_QUOTE); + if (i<0) + return etag; + return etag.substring(0,i)+'"'; + } + public GzipHttpContent(HttpContent content, HttpContent contentGz) { _content=content; |