Skip to content

Commit

Permalink
Issue #987 - remove checkGzExists from GzipHandler entirely
Browse files Browse the repository at this point in the history
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
  • Loading branch information
joakime committed Mar 27, 2018
1 parent f56fb44 commit 7792fba
Showing 1 changed file with 0 additions and 34 deletions.
Expand Up @@ -18,7 +18,6 @@

package org.eclipse.jetty.server.handler.gzip;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.EnumSet;
Expand Down Expand Up @@ -156,7 +155,6 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory

private int _minGzipSize=DEFAULT_MIN_GZIP_SIZE;
private int _compressionLevel=Deflater.DEFAULT_COMPRESSION;
private boolean _checkGzExists = true;
private boolean _syncFlush = false;
private int _inflateBufferSize = -1;
private EnumSet<DispatcherType> _dispatchers = EnumSet.of(DispatcherType.REQUEST);
Expand Down Expand Up @@ -399,11 +397,6 @@ protected void doStart() throws Exception
super.doStart();
}

public boolean getCheckGzExists()
{
return _checkGzExists;
}

public int getCompressionLevel()
{
return _compressionLevel;
Expand Down Expand Up @@ -690,22 +683,6 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques
}
}

if (_checkGzExists && context!=null)
{
String realpath=request.getServletContext().getRealPath(path);
if (realpath!=null)
{
File gz=new File(realpath+".gz");
if (gz.exists())
{
LOG.debug("{} gzip exists {}",this,request);
// allow default servlet to handle
_handler.handle(target,baseRequest, request, response);
return;
}
}
}

HttpOutput.Interceptor orig_interceptor = out.getInterceptor();
try
{
Expand Down Expand Up @@ -775,17 +752,6 @@ public void recycle(Deflater deflater)
deflater.end();
}

/**
* Set the Check if {@code *.gz} file for the incoming file exists.
*
* @param checkGzExists whether to check if a static gz file exists for
* the resource that the DefaultServlet may serve as precompressed.
*/
public void setCheckGzExists(boolean checkGzExists)
{
_checkGzExists = checkGzExists;
}

/**
* Set the Compression level that {@link Deflater} uses.
*
Expand Down

0 comments on commit 7792fba

Please sign in to comment.