// Chrome sucks.
// http://dev.equella.com/issues/8025
// http://dev.equella.com/issues/5612
@SuppressWarnings("nls")
  @Override
  protected FilterResult doFilterInternal(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    response = new IgnoreContentWrapper(response);
    response.addHeader("P3P", "CP=\"CAO PSA OUR\"");
    response.setHeader("X-Content-Type-Options", "nosniff");
    // Chrome sucks.
    // http://dev.equella.com/issues/8025
    // http://dev.equella.com/issues/5612
    String ua = request.getHeader("User-Agent");
    if (ua != null && ua.contains("Chrome")) {
      response.addHeader("X-XSS-Protection", "0");
    } else {
      response.setHeader("X-XSS-Protection", "1; mode=block");
    }
    if (stsMaxAge != -1) {
      response.setHeader(
          "Strict-Transport-Security", "max-age=" + stsMaxAge + "; includeSubDomains");
    }
    return new FilterResult(response);
  }
response.addHeader("P3P", "CP=\"CAO PSA OUR\"");
response.setHeader("X-Content-Type-Options", "nosniff");
// Chrome sucks.
// http://dev.equella.com/issues/8025
// http://dev.equella.com/issues/5612
String ua = request.getHeader("User-Agent");
if (ua != null && ua.contains("Chrome")) {
@SuppressWarnings("nls")
@Override
protected FilterResult doFilterInternal(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response = new IgnoreContentWrapper(response);
response.addHeader("P3P", "CP=\"CAO PSA OUR\"");
response.setHeader("X-Content-Type-Options", "nosniff");
// Chrome sucks.
// http://dev.equella.com/issues/8025
// http://dev.equella.com/issues/5612
String ua = request.getHeader("User-Agent");
if (ua != null && ua.contains("Chrome")) {
response.addHeader("X-XSS-Protection", "0");
} else {
response.setHeader("X-XSS-Protection", "1; mode=block");
}
if (stsMaxAge != -1) {
response.setHeader(
"Strict-Transport-Security", "max-age=" + stsMaxAge + "; includeSubDomains");
}
@SuppressWarnings("nls")
@Override
protected FilterResult doFilterInternal(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response = new IgnoreContentWrapper(response);
response.addHeader("P3P", "CP=\"CAO PSA OUR\"");
response.setHeader("X-Content-Type-Options", "nosniff");
// Chrome sucks.
// http://dev.equella.com/issues/8025
// http://dev.equella.com/issues/5612
String ua = request.getHeader("User-Agent");
if (ua != null && ua.contains("Chrome")) {
response.addHeader("X-XSS-Protection", "0");
} else {
response.setHeader("X-XSS-Protection", "1; mode=block");
}
if (stsMaxAge != -1) {
response.setHeader(
"Strict-Transport-Security", "max-age=" + stsMaxAge + "; includeSubDomains");
}
return new FilterResult(response);
}