这两天搞个JS跨域请求,发现用户是Windows服务器,用的IIS,而且跨域还是多域名,完了撒.IIS自带的HTTP标头只能填写一个值.特意网上溜达了一圈,发现不少人遇到这个问题都没解决.如下图所示.

默认生成web.config如下:
<?xml version=”1.0” encoding=”UTF-8”?>
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name=”Access-Control-Allow-Origin” value=”*” />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>