I have a php+laravel API application hosted in azure app service.I have the same app hosted in apache in azure as well. The rest end points works properly in apache but in IIS hosted environment all the PUT verbs are failing with 405 (Method Not Allowed) error. I did not try DELETE yet but based on what I am seeing all preflight redirect verbs should be failing.
I spend a week on this, let me first explain what I did so far; I have added following to my web.config
<httpProtocol>
<customHeaders>
<add name="Strict-Transport-Security" value="max-age=31536000; includeSubDomains"/>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="X-Requested-With,Content-Type" />
<add name="Access-Control-Allow-Methods" value="POST,GET,OPTIONS,DELETE,PUT,PATCH" />
</customHeaders>
</httpProtocol>
With the access-control-allow-methods, I could by pass OPT calls from my front end application.
I tried few of the suggestion mentioned in Laravel 5.1 API Enable Cors answers. Also followed http://codecipher.in/laravel-cors/ so that I could avoid OPT calls from my client side. These changes did allow me to skip OPT calls and able to make my PUT. Unfortunately the PUT calls though it is still failing.
I called the PUT endpoint through postman and I get "The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used." error. In the headers I can see
access-control-allow-methods →POST,GET,OPTIONS,DELETE,PUT,PATCH
but I did see allow as
allow →GET, HEAD, OPTIONS, TRACE
Like I mentioned, the application hosted in Apache works just fine and I would like to give it a try in IIS before I give up and move completely to Apache.
What does IIS uses to prevent calls to PUT verb not to execute?
Thanks