[英]Is response header “X-XSS-Protection” supported in jsp 1.2?
I am trying to add the header "X-XSS-Protection" to the response object in a jsp. 我正在尝试将标题“ X-XSS-Protection”添加到jsp的响应对象中。
my code in jsp... 我在jsp中的代码...
<%
response.addHeader("X-XSS-Protection","1; mode=block");
System.out.println("!!!!!!!!!Testing X-XSS "+response.containsHeader("X-XSS-Protection"));
%>
on the console I get the below result. 在控制台上,我得到以下结果。
!!!!!!!!!Testing X-XSS false !!!!!!!!!测试X-XSS否
这通常意味着响应的一部分已经被写入,因此添加标头为时已晚。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.