Cors
No edit summary
No edit summary
Line 12: Line 12:
  </configuration></pre>To do this on App level - change Web.config in the same way - but beware that web-config is part of installation and will be replaced on update.
  </configuration></pre>To do this on App level - change Web.config in the same way - but beware that web-config is part of installation and will be replaced on update.


Good links: https://www.w3.org/wiki/CORS_Enabled https://docs.microsoft.com/en-us/aspnet/web-api/overview/security/enabling-cross-origin-requests-in-web-api
Good links:  
* https://www.w3.org/wiki/CORS_Enabled
 
* https://docs.microsoft.com/en-us/aspnet/web-api/overview/security/enabling-cross-origin-requests-in-web-api
Testing that CORS is active, you can use for example this online tool. Just enter the root URL of your site in "Remote URL"
 
https://www.test-cors.org/

Revision as of 21:22, 13 September 2020

To enable cors on IIS - all sites on the machine:

Add a or change web.config on the root web site (Default Web site)

<?xml version="1.0" encoding="utf-8"?>  
<configuration>    
  <system.webServer>      
    <httpProtocol>        
      <customHeaders>          
        <add name="Access-Control-Allow-Origin" value="*" />        
      </customHeaders>      
    </httpProtocol>    
   </system.webServer>  
 </configuration>

To do this on App level - change Web.config in the same way - but beware that web-config is part of installation and will be replaced on update.

Good links:

Testing that CORS is active, you can use for example this online tool. Just enter the root URL of your site in "Remote URL"

https://www.test-cors.org/

This page was edited 31 days ago on 03/26/2024. What links here