449811 handle unquoted etags when gzipping

This commit is contained in:
Greg Wilkins 2014-11-05 11:12:17 +11:00
parent 3164243fb8
commit 4cb8e7f644
1 changed files with 7 additions and 2 deletions

View File

@ -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);