}
// Cross-site scripting
- // See https://www.owasp.org/index.php/List_of_useful_HTTP_headers
- httpResponse.setHeader("X-XSS-Protection", "1; mode=block");
+ // See https://cheatsheetseries.owasp.org/cheatsheets/HTTP_Headers_Cheat_Sheet.html#x-xss-protection
+ httpResponse.setHeader("X-XSS-Protection", "0");
// MIME-sniffing
- // See https://www.owasp.org/index.php/List_of_useful_HTTP_headers
+ // See https://cheatsheetseries.owasp.org/cheatsheets/HTTP_Headers_Cheat_Sheet.html#x-content-type-options
httpResponse.setHeader("X-Content-Type-Options", "nosniff");
}
underTest.invoke(request, response);
verify(response).setHeader("X-Frame-Options", "SAMEORIGIN");
- verify(response).setHeader("X-XSS-Protection", "1; mode=block");
+ verify(response).setHeader("X-XSS-Protection", "0");
verify(response).setHeader("X-Content-Type-Options", "nosniff");
verify(response).setHeader("Strict-Transport-Security", "max-age=31536000; includeSubDomains;");
}
underTest.doFilter(request, response, chain);
verify(response).setHeader("X-Frame-Options", "SAMEORIGIN");
- verify(response).setHeader("X-XSS-Protection", "1; mode=block");
+ verify(response).setHeader("X-XSS-Protection", "0");
verify(response).setHeader("X-Content-Type-Options", "nosniff");
assertNull(response.getHeader("Strict-Transport-Security"));
}
underTest.doFilter(request, response, chain);
verify(response).setHeader("X-Frame-Options", "SAMEORIGIN");
- verify(response).setHeader("X-XSS-Protection", "1; mode=block");
+ verify(response).setHeader("X-XSS-Protection", "0");
verify(response).setHeader("X-Content-Type-Options", "nosniff");
verify(response).setHeader("Strict-Transport-Security", "max-age=31536000; includeSubDomains;");
}
underTest.doFilter(request, response, chain);
verify(response, never()).setHeader(eq("X-Frame-Options"), anyString());
- verify(response).setHeader("X-XSS-Protection", "1; mode=block");
+ verify(response).setHeader("X-XSS-Protection", "0");
verify(response).setHeader("X-Content-Type-Options", "nosniff");
}
underTest.doFilter(request, response, chain);
verify(response, never()).setHeader(eq("X-Frame-Options"), anyString());
- verify(response).setHeader("X-XSS-Protection", "1; mode=block");
+ verify(response).setHeader("X-XSS-Protection", "0");
verify(response).setHeader("X-Content-Type-Options", "nosniff");
}