mardi 24 mars 2015

How to allow DELETE requests on EC2

I am having trouble exectuting DELETE requests on my asp.net web api hosted on EC2. I keep getting 403 Access Denied on DELETE (OPTIONS request is successful). Is it that DELETE is blocked by firewall on EC2, as Wireshark is also not able to capture it.


I have enabled CORS as -



[EnableCors(origins: "*", headers: "*", methods: "*")]


And this is my Web.config -



<modules runAllManagedModulesForAllRequests="true">
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
<remove name="WebDAVModule" />
</modules>

<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<remove name="WebDAV"/>
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>


Everything works fine on my local dev machine. In EC2, this call breaks. Please tell what is the issue here.





Aucun commentaire:

Enregistrer un commentaire