Merge remote-tracking branch 'origin/jetty-9.4.x'
This commit is contained in:
commit
269f9643f0
|
@ -61,8 +61,8 @@ public class CompressedContentFormat
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
int dashdash = tag.indexOf("--");
|
int dashdash = tag.indexOf("--");
|
||||||
if (dashdash>0)
|
if (dashdash>0 && dashdash==etag.length()-1)
|
||||||
return etag.regionMatches(0,tag,0,dashdash-2);
|
return etag.regionMatches(0,tag,0,dashdash);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -895,6 +895,10 @@ public class DefaultServletTest
|
||||||
assertResponseNotContains("Content-Encoding: gzip",response);
|
assertResponseNotContains("Content-Encoding: gzip",response);
|
||||||
assertResponseNotContains("ETag: "+etag_gzip,response);
|
assertResponseNotContains("ETag: "+etag_gzip,response);
|
||||||
assertResponseContains("ETag: ",response);
|
assertResponseContains("ETag: ",response);
|
||||||
|
|
||||||
|
String bad_etag_gzip = etag.substring(0,etag.length()-2)+"X--gzip\"";
|
||||||
|
response = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:gzip\r\nIf-None-Match: "+bad_etag_gzip+"\r\n\r\n");
|
||||||
|
assertResponseNotContains("304 Not Modified", response);
|
||||||
|
|
||||||
response = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:gzip\r\nIf-None-Match: "+etag_gzip+"\r\n\r\n");
|
response = connector.getResponse("GET /context/data0.txt HTTP/1.0\r\nHost:localhost:8080\r\nAccept-Encoding:gzip\r\nIf-None-Match: "+etag_gzip+"\r\n\r\n");
|
||||||
assertResponseContains("304 Not Modified", response);
|
assertResponseContains("304 Not Modified", response);
|
||||||
|
|
Loading…
Reference in New Issue