Issue #987 - remove checkGzExists from GzipHandler entirely
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
parent
f56fb440a5
commit
7792fba29e
|
@ -18,7 +18,6 @@
|
||||||
|
|
||||||
package org.eclipse.jetty.server.handler.gzip;
|
package org.eclipse.jetty.server.handler.gzip;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
@ -156,7 +155,6 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory
|
||||||
|
|
||||||
private int _minGzipSize=DEFAULT_MIN_GZIP_SIZE;
|
private int _minGzipSize=DEFAULT_MIN_GZIP_SIZE;
|
||||||
private int _compressionLevel=Deflater.DEFAULT_COMPRESSION;
|
private int _compressionLevel=Deflater.DEFAULT_COMPRESSION;
|
||||||
private boolean _checkGzExists = true;
|
|
||||||
private boolean _syncFlush = false;
|
private boolean _syncFlush = false;
|
||||||
private int _inflateBufferSize = -1;
|
private int _inflateBufferSize = -1;
|
||||||
private EnumSet<DispatcherType> _dispatchers = EnumSet.of(DispatcherType.REQUEST);
|
private EnumSet<DispatcherType> _dispatchers = EnumSet.of(DispatcherType.REQUEST);
|
||||||
|
@ -399,11 +397,6 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory
|
||||||
super.doStart();
|
super.doStart();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getCheckGzExists()
|
|
||||||
{
|
|
||||||
return _checkGzExists;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getCompressionLevel()
|
public int getCompressionLevel()
|
||||||
{
|
{
|
||||||
return _compressionLevel;
|
return _compressionLevel;
|
||||||
|
@ -690,22 +683,6 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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();
|
HttpOutput.Interceptor orig_interceptor = out.getInterceptor();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -775,17 +752,6 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory
|
||||||
deflater.end();
|
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.
|
* Set the Compression level that {@link Deflater} uses.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue