网站漏洞解决-[轻微]WEB服务器启动了OPTIONS方法

来源:互联网 发布:宠物小精灵是什么软件 编辑:程序博客网 时间:2024/04/30 00:49

解决方法:

使所有项目都执行,修改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>      <login-config>          <auth-method>BASIC</auth-method>      </login-config>
若只想某个项目使用,只需要在该项目的web.xml文件添加上述代码。


阅读全文
0 0
原创粉丝点击