如果web.conig中的http选项已配置为OPTIONS=false,则在applicationhost.config中配置http OPTIONS=true时,我的网站会发生什么情况
ApplicationHostFile =>添加http选项= false我的网站级别web.config =>添加http选项= true
哪一个会优先?在启动我的网站时会得到任何服务器错误的问题吗?
例如:如果在applicationhost.config中添加http响应头,我们会得到“不允许重复”的错误。那么当两个文件有相同的头时,我们会得到RequestFiltering http动词的错误吗?
发布于 2021-07-12 19:42:49
如果在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>https://stackoverflow.com/questions/68321902
复制相似问题