I am enabling cors between two sites. I have enabled the cors in global.asax.cs
.
Still I am facing problems
No 'Access-Control-Allow-Origin' header is present on the requested resource
When I added in my web.config
:
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Methods" value="GET, PUT, POST, DELETE, HEAD" />
<add name="Access-Control-Allow-Headers" value="Origin, Authorization, X-Requested-With, Content-Type, Accept" />
</customHeaders>
Then I am getting error - only one header is allow no multiple header allow.
Request Header
Access-control-request-headrs : authorization , content-type
Access-control-request-method :GET
Origin- xyz.com
Response Header
Allow:OPTIONS,TRACE,GET,HEAD,POST
CONTENT-LENGHT :0
GENERAL
REQUEST URL: ABC.COM
RQUEST METHOD : OPTIONS
STATUS CODE:200 OK