用户是否在HttpServletRequest中禁用了gzip(例如用于基准测试)
import java.io.IOException; import java.io.PrintWriter; import java.util.zip.GZIPOutputStream;/* from 时代Java*/ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class Main{ /** Has user disable gzip (e.g., for benchmarking)? */ public static boolean isGzipDisabled(HttpServletRequest request) { String flag = request.getParameter("disabledGzip"); return ((flag !=