0

What will happen to my website when configure http [OPTIONS=true] in web.conig if http OPTIONS is already configured in applicationhost.config as [OPTIONS=false]?

ApplicationHostFile => added http OPTIONS = false My website level web.config => adding http OPTIONS = true

Which one will take priority? & will get any issue [server error] while launching my website?

[Ex: We will get error saying that "duplicate' not allowed if add http response header in applicationhost.config. So something like we will get any error for RequestFiltering http verbs when both file have same headers?]

saravana
  • 544
  • 1
  • 7
  • 26
  • What is "My website level"? If you mean `web.config` in your web site, I don't think any request filtering settings can be overridden there. – Lex Li Jul 09 '21 at 22:48
  • Meant my website level web.config. @Lex Li we can configure request filtering in website level as well. I just want to know what will happen if applicationHost file have the same verb entry? – saravana Jul 10 '21 at 11:36
  • You are using IIS to host your service, so the priority of Web.config file will be higher than use a Web.config file. – samwu Jul 12 '21 at 08:58
  • Yes. It is considering the configuration from my website web.config by adding the and in system.webServer/security/requestFiltering section even though configured the same verb in the Applicationhost.config. Thank you. – saravana Jul 12 '21 at 11:35

1 Answers1

0

If HTTP verbs configured in Applicatiohost.config file like,

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

this can be overridden in our website web.config section by configuring like,

<system.webServer>
   <security>
    <requestFiltering>
      <verbs>
         <remove verb="OPTIONS" />
         <add verb="OPTIONS" allowed="false" />
      </verbs>
     </requestFiltering>
   </security>
 </system.webServer>
saravana
  • 544
  • 1
  • 7
  • 26