I am trying to show maps that are loaded from ArcGIS Server that we locally host, and I keep having trouble with (CORS).
I have to mention that when I launch the program within the WebStorm, it works just fine and everything loads with no problem. But when I copy the files on the webserver, and having IIS deliver the pages I keep getting the following error:
Image from origin 'AddressRemoved' has been blocked from loading by Cross-Origin Resource Sharing policy: The 'Access-Control-Allow-Origin' header has a value 'http://localhost:63342' that is not equal to the supplied origin. Origin 'http://localhost' is therefore not allowed access.
* I change the first address to to "AddressRemoved
I have provided a web.config file with the following content:
<?xml version="1.0" encoding="utf-8"?>
<remove name="Access-Control-Allow-Origin" />
<add name="Access-Control-Allow-Origin" value="*" />
The above line is supposed to fix this problem but some how it is not. Any help or idea?