What can I do to make this running?
Backend: ASP .Net Web APP - API, IIS
Frontend: Vue
Error:
Fiddler:
web.config:
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="x-requested-with, Content-Type, origin, authorization, accept, client-security-token" />
<add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" />
<add name="Access-Control-Max-Age " value="1000" />
</customHeaders>
</httpProtocol>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
Conclusions so far:
- The error goes away if I skip sending data in the post request.
- I assume this is because I no longer will break SOP policy when the post data is not there.
- A preflight request is only done when using some unsafe headers/methods/content types.
Please only answer if you have understanding of this matter (I'm sorry for this but looking in similar questions the repsonses are much of the kind "try this" and "try that" which makes it hard to identify the root cause and boost general understanding). Thanks for considering this.