424899 Initialize GzipHandler mimeTypes

This commit is contained in:
Greg Wilkins 2014-02-17 13:04:27 +11:00
parent abb70b3bca
commit 352a1303e0
1 changed files with 20 additions and 0 deletions

View File

@ -36,6 +36,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.http.HttpMethod;
import org.eclipse.jetty.http.MimeTypes;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.handler.HandlerWrapper;
import org.eclipse.jetty.util.log.Log;
@ -243,6 +244,25 @@ public class GzipHandler extends HandlerWrapper
{
_minGzipSize = minGzipSize;
}
/* ------------------------------------------------------------ */
@Override
protected void doStart() throws Exception
{
if (_mimeTypes.size()==0)
{
for (String type:MimeTypes.getKnownMimeTypes())
{
if (type.startsWith("image/")||
type.startsWith("audio/")||
type.startsWith("video/"))
_mimeTypes.add(type);
_mimeTypes.add("application/compress");
_mimeTypes.add("application/zip");
_mimeTypes.add("application/gzip");
}
}
}
/* ------------------------------------------------------------ */
/**