Hello. I added custom http response headers to my SP site web config file as follows:
<httpProtocol><customHeaders><add name="Access-Control-Allow-Methods" value="POST,GET,OPTIONS" /><add name="Access-Control-Allow-Origin" value="*" /><add name="Access-Control-Allow-Headers" value="Content-Type,Authorization" /></customHeaders></httpProtocol>
When I try to call any web service, i get these headers two times each:
HTTP/1.1 200 OKCache-Control: private, max-age=0
Transfer-Encoding: chunked
Content-Type: application/atom+xml;type=entry;charset=utf-8
Expires: Sat, 01 Mar 2014 19:11:37 GMT
Last-Modified: Sun, 16 Mar 2014 19:11:37 GMT
ETag: "3"
X-SharePointHealthScore: 0
SPClientServiceRequestDuration: 20
SPRequestGuid: b4e77d9c-bfc3-a050-493a-ca5d251d1a72
request-id: b4e77d9c-bfc3-a050-493a-ca5d251d1a72
X-FRAME-OPTIONS: SAMEORIGIN
Persistent-Auth: true
Access-Control-Allow-Methods: POST,GET,OPTIONS
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type,Authorization
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Access-Control-Allow-Methods: POST,GET,OPTIONS
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type,Authorization
MicrosoftSharePointTeamServices: 15.0.0.4569
Date: Sun, 16 Mar 2014 19:11:37 GMT
and that gives me error from ajax: The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed. Origin 'null' is therefore not allowed access.
Does any one has any ideas? Any help mush appreciated! :)