如何解决可以在我的网站中覆盖 applicationhost.config 中 http 动词的 RequestFiltering 值吗?
如果 http OPTIONS 已经在 applicationhost.config 中配置为 [OPTIONS=false],那么在 web.conig 中配置 http [OPTIONS=true] 时我的网站会发生什么?
ApplicationHostFile => 添加了 http OPTIONS = false 我的网站级别 web.config => 添加 http OPTIONS = true
哪个优先? & 在启动我的网站时会遇到任何问题 [服务器错误]?
[例如: 如果在 applicationhost.config 中添加 http 响应标头,我们将收到错误消息,指出“不允许重复”。因此,当两个文件具有相同的标头时,我们会收到 requestfiltering http 动词的任何错误吗?]
解决方法
如果在 Applicatiohost.config 文件中配置了 HTTP 动词,例如,
<system.webServer>
<security>
<requestFiltering>
<verbs allowUnlisted="true" applyToWebDAV="true">
<add verb="OPTIONS" allowed="false" />
</verbs>
</requestFiltering>
</security>
</system.webServer>
这可以在我们的网站 web.config 部分中通过配置来覆盖,
<system.webServer>
<security>
<requestFiltering>
<verbs>
<remove verb="OPTIONS" />
<add verb="OPTIONS" allowed="false" />
</verbs>
</requestFiltering>
</security>
</system.webServer>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。