2
在Tomcat上禁止HTTP方法区分大小写吗?
我将以下内容放入应用程序的web.xml中,以尝试禁止PUT,DELETE等: <security-constraint> <web-resource-collection> <web-resource-name>restricted methods</web-resource-name> <url-pattern>/*</url-pattern> <http-method>DELETE</http-method> <http-method>PUT</http-method> <http-method>SEARCH</http-method> <http-method>COPY</http-method> <http-method>MOVE</http-method> <http-method>PROPFIND</http-method> <http-method>PROPPATCH</http-method> <http-method>MKCOL</http-method> <http-method>LOCK</http-method> <http-method>UNLOCK</http-method> <http-method>delete</http-method> <http-method>put</http-method> <http-method>search</http-method> <http-method>copy</http-method> <http-method>move</http-method> <http-method>propfind</http-method> <http-method>proppatch</http-method> <http-method>mkcol</http-method> <http-method>lock</http-method> <http-method>unlock</http-method> </web-resource-collection> <auth-constraint /> </security-constraint> 好的,所以现在: 如果我使用的方法发出请求,DELETE则会返回403。 如果我使用的方法发出请求,delete则会返回403。 但 如果我用的方法提出要求,DeLeTe我会确定的! 如何使它们不区分大小写? 编辑:我正在使用C#程序对其进行测试: private void button1_Click(object sender, EventArgs e) { textBox1.Text = "making request"; System.Threading.Thread.Sleep(400); WebRequest …
11
tomcat