0

I am getting CORS policy error. I am trying to use URL Rewrite plug in. I have IIS 10. I tried the examples(links) below, but it still didn't work. So What can i do more?

https://techcommunity.microsoft.com/t5/microsoft-sharepoint-blog/fixing-issue-in-making-cross-domain-ajax-call-to-sharepoint-rest/ba-p/510001

https://www.carlosag.net/articles/enable-cors-access-control-allow-origin.cshtml

0

Long time ago I had that issue too on IIS 10.

Tricks with URL Rewriter and native web.config settings are not working fully.

CORS added in the meanwhile preflight request (method "OPTION" within request headers) which is not supported by default by IIS.

At that period I did a custom WebHttpBehavior to handle all of CORS requests then deployed and configured on each IIS front ends. Unfortunately my source code is obsolete now.

However, you can find a really well implementation of a custom WebHttpBehavior on the GitHub repo cshandler/WebHttpBehaviorExtensions

The installation and settings are pretty straightforward as the documentation is well done.

Just as reference, the source code I did in the past: vherrlein/iis-enablingcors

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.