mirror of https://github.com/apache/druid.git
Merge pull request #987 from gianm/gzip-filter-taming
Disable checkGzExists in the default GzipFilter.
This commit is contained in:
commit
2c533547c3
|
@ -31,17 +31,26 @@ public abstract class BaseJettyServerInitializer implements JettyServerInitializ
|
||||||
|
|
||||||
public static final String GZIP_METHODS = Joiner.on(",").join(HttpMethod.GET, HttpMethod.POST);
|
public static final String GZIP_METHODS = Joiner.on(",").join(HttpMethod.GET, HttpMethod.POST);
|
||||||
|
|
||||||
public FilterHolder defaultGzipFilterHolder() {
|
public FilterHolder defaultGzipFilterHolder()
|
||||||
|
{
|
||||||
final FilterHolder gzipFilterHolder = new FilterHolder(GzipFilter.class);
|
final FilterHolder gzipFilterHolder = new FilterHolder(GzipFilter.class);
|
||||||
gzipFilterHolder.setInitParameter("minGzipSize", "0");
|
setDefaultGzipFilterHolderParameters(gzipFilterHolder);
|
||||||
gzipFilterHolder.setInitParameter("methods", GZIP_METHODS);
|
|
||||||
return gzipFilterHolder;
|
return gzipFilterHolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FilterHolder defaultAsyncGzipFilterHolder() {
|
public FilterHolder defaultAsyncGzipFilterHolder()
|
||||||
|
{
|
||||||
final FilterHolder gzipFilterHolder = new FilterHolder(AsyncGzipFilter.class);
|
final FilterHolder gzipFilterHolder = new FilterHolder(AsyncGzipFilter.class);
|
||||||
gzipFilterHolder.setInitParameter("minGzipSize", "0");
|
setDefaultGzipFilterHolderParameters(gzipFilterHolder);
|
||||||
gzipFilterHolder.setInitParameter("methods", GZIP_METHODS);
|
|
||||||
return gzipFilterHolder;
|
return gzipFilterHolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void setDefaultGzipFilterHolderParameters(final FilterHolder filterHolder)
|
||||||
|
{
|
||||||
|
filterHolder.setInitParameter("minGzipSize", "0");
|
||||||
|
filterHolder.setInitParameter("methods", GZIP_METHODS);
|
||||||
|
|
||||||
|
// We don't actually have any precomputed .gz resources, and checking for them inside jars is expensive.
|
||||||
|
filterHolder.setInitParameter("checkGzExists", String.valueOf(false));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue