Trying to understand and debug an issue with a CORS setup on WebAPI 2. My front-end angular/javascript application communicates with my API at
which sometimes returns the following error:
The 'Access-Control-Allow-Origin' header has a value 'http://example.com' that is not equal to the supplied origin. Origin 'http://www.example.com' is therefore not allowed access.
Testing the api link on Fiddler returns the following in the headers:
Access-Control-Allow-Origin: http://example.com
Why would this happen and how do I address this situation?
http://example.comand on the other you havehttp://www.example.com(note thewww). these are not the same origin. nor isapi.example.comwhich seems like it's more likely what is in one of these changed errors.