ITeye博客

Tomcat中禁用OPTIONS/DELETE等

xuxujing · 2014-11-19 09:49 · Tomcat · 行业应用 · Markdown

测试:
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>

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。