Copy acceptsGzipEncoding method from gwtjsonrpc

This is a tiny utility that we don't need to bring in a whole external
dependency for.

Change-Id: I3d5d4e9f8d9272861c890ad59fca1662b05d608c
This commit is contained in:
Dave Borowitz
2018-12-18 18:18:27 -08:00
parent 29b39cf164
commit d693d9b71e
6 changed files with 16 additions and 11 deletions

View File

@@ -89,5 +89,10 @@ public class RequestUtil {
return result.toString();
}
public static boolean acceptsGzipEncoding(HttpServletRequest request) {
String accepts = request.getHeader("Accept-Encoding");
return accepts != null && accepts.indexOf("gzip") != -1;
}
private RequestUtil() {}
}