测试:
curl -v -X OPTIONS http://localhost:8080/a/
curl -v -X OPTIONS http://localhost:8080/b.jsp
Tomcat的Web.xml中添加如下配置:
<security-constraint>
<web-resource-collection>
<url-pattern>/*</url-pattern>
<http-method>PUT</http-method>
<http-method>DELETE</http-method>
<http-method>HEAD</http-method>
<http-method>OPTIONS</http-method>
<http-method>TRACE</http-method>
</web-resource-collection>
<auth-constraint></auth-constraint>
</security-constraint>
本文详细介绍了如何在Tomcat的Web.xml中配置安全约束,实现对PUT、DELETE、HEAD、OPTIONS和TRACE请求的权限控制,并通过curl命令进行安全测试。
1593

被折叠的 条评论
为什么被折叠?



