To resolve the CORS issue I have added the following headers in the web.config file of SharePoint 2013
<add name="Access-Control-Allow-Origin" value="http://localhost:4200" /> <add name="Access-Control-Allow-Headers" value="Content-Type,Accept,X-FORMS_BASED_AUTH_ACCEPTED,crossDomain,credentials,X-RequestDigest " /> <add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" /> <add name="Access-Control-Allow-Credentials" value="true" />
After this I am able to execute the SharePoint REST Api AJAX calls from the cross domain. But now I want to add another URL to the header
<add name="Access-Control-Allow-Origin" value="http://localhost:4200" />
I cannot put * in the value as I am also allowing the credentials. Is there any way that I can add one more URL to this header.
Thanks in advance..