1

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

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

谢谢。

4

1 回答 1

1

来自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

于 2019-12-03T10:37:28.217 回答