如何在ASP.NET MVC上禁用TRACE Http方法

问题描述 投票:1回答:1

我们在IIS 7.5中托管了一个asp.net mvc 3应用程序。出于安全原因,我们需要禁用TRACE HTTP METHOD。

我在Google上搜索了一下,但找不到上面的任何具体示例。有人可以帮忙,如何通过IIS设置或通过web.config来实现。

谢谢。

asp.net-mvc-3 security http
1个回答
0
投票

web.config开始

<configuration>
 <system.webServer>
  <security>
   <requestFiltering>
    <verbs allowUnlisted="true">
     <add verb="TRACE" allowed="false" />
    </verbs>
   </requestFiltering>
  </security>
 </system.webServer>
</configuration>

参考:https://docs.microsoft.com/en-us/iis/manage/configuring-security/use-request-filtering#filter-by-verbs

© www.soinside.com 2019 - 2024. All rights reserved.