服务器 Gind.cn

服务器问题集锦,包括 Linux(Ubuntu, Centos,Debian等)和Windows Server服务器

不允许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方法做一个请求,我就OK了! 我怎样才能让它不允许这些不区分大小写? 编辑:我正在testing它与C#程序: private void button1_Click(object sender, EventArgs e) { textBox1.Text = "making request"; System.Threading.Thread.Sleep(400); WebRequest req = WebRequest.Create("http://serverurl/Application/cache_test.jsp"); req.Method = […]