IIS CORS Access-Control-Allow-Origin' header contains multiple values

05-10-2022 05:12 AM
Occasional Contributor II

Hi all,

Again, i am about CORS issue.

I sue IIS for my web map.

So, in my map i sue wms service from another server, that's why i get CORS issue. When i use CORS extension on chrome, i can use this service without problem. 

I looked around in google, in stack, but could not find decision of this. 

In web.config i have added:



<?xml version="1.0" encoding="utf-8"?>
        <httpProtocol allowKeepAlive="false">
              <clear />
                <add name="Access-Control-Allow-Origin" value="*" />
                <add name="Access-Control-Allow-Methods" value="GET, PUT, POST, DELETE, HEAD, OPTIONS" />
                <add name="Access-Control-Allow-Headers" value="*" />



but no result, still  Access-Control-Allow-Origin' header contains multiple values. 

My map is in Default web Site folder. 

I used proxy, but it did  not help.

Any ideas how it could be fixed?

4 Replies
Frequent Contributor II

edit - Is this on the server you are trying to get the WMS from?

0 Kudos
Occasional Contributor II

WMS is outsource, it is on another server and i have no access on it to change CORS options. 

0 Kudos
Frequent Contributor II

Ah, you can't fix this via your server then. The origin server has deliberately disabled CORS or only has certain allows. You can try to write a proxy server for this. The crossorigin.me dev site publishes their source code and you can try to use that as a base for your own. https://github.com/corihudson/crossorigin.me

0 Kudos
New Contributor III

The CORS extension on Chrome has helped me too. Thank you