我想在web.config
中禁用HTTP方法,但我无法做到。我只想启用GET
& POST
方法。试过这样:
<security>
<requestFiltering>
<verbs allowUnlisted="false" applyToWebDAV="true">
<clear/>
<add verb="GET" allowed="true" />
<add verb="POST" allowed="true" />
<add verb="OPTIONS" allowed="false" />
<add verb="TRACE" allowed="false"/>
<add verb="TRACK" allowed="false"/>
<add verb="HEAD" allowed="false"/>
<add verb="PROPFIND" allowed="false"/>
<add verb="PUT" allowed="false"/>
<add verb="COPY" allowed="false"/>
<add verb="LOCK" allowed="false"/>
<add verb="UNLOCK" allowed="false"/>
<add verb="PROPPATCH" allowed="false"/>
<add verb="MKCOL" allowed="false"/>
<add verb="MOVE" allowed="false"/>
<add verb="DELETE" allowed="false"/>
<add verb="SEARCH" allowed="false"/>
</verbs>
</requestFiltering>
</security>
我做错了吗?我已经搜索了很多,但您更喜欢禁用此动词?
答案 0 :(得分:0)
只是有点预感,您可以尝试删除applytoWebDAV属性并查看吗?
<requestFiltering>
<verbs allowUnlisted="false">
<add verb="GET" allowed="true" />
</verbs>
</requestFiltering>
我认为WebDAV扩展模块可能与它有关。通常,如果您转到IIS和请求筛选,您可以允许/拒绝动词。它最终会生成您提到的相同配置文件。