@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);
  }
@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");
   
   
   
    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);
  }
@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"); 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); }