From 4b94aa2c97be7148dfe690be457aa4521ff7fd3a Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 7 Apr 2016 11:39:34 +1000 Subject: [PATCH] Issue #491 Do not assume gzip acceptable for HTTP/2 Removed the HTTP/2 specific code for #491 --- .../server/handler/gzip/GzipHandler.java | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHandler.java index 6c0a584211e..a2387ce3496 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHandler.java @@ -260,23 +260,20 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory return null; } - // If not HTTP/2, then we must check the accept encoding header - if (request.getHttpVersion()!=HttpVersion.HTTP_2) + // check the accept encoding header + HttpField accept = request.getHttpFields().getField(HttpHeader.ACCEPT_ENCODING); + + if (accept==null) { - HttpField accept = request.getHttpFields().getField(HttpHeader.ACCEPT_ENCODING); + LOG.debug("{} excluded !accept {}",this,request); + return null; + } + boolean gzip = accept.contains("gzip"); - if (accept==null) - { - LOG.debug("{} excluded !accept {}",this,request); - return null; - } - boolean gzip = accept.contains("gzip"); - - if (!gzip) - { - LOG.debug("{} excluded not gzip accept {}",this,request); - return null; - } + if (!gzip) + { + LOG.debug("{} excluded not gzip accept {}",this,request); + return null; } Deflater df = _deflater.get();