Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I have a Web API that implementing CORS this way and this is working fine when I call the API on the same network making a CORS Jquery request to the API but this won't work when I try to access it over domain name. So it works when I do

http://12.12.12.13/MyAPI/MyControler/MyAction

but won't work when I do

http://api.mydomain.com/MyAPI/MyControler/MyAction

even if 12.12.12.13 and api.mydomain.com are the same server... Why? I also did check the headers using Fiddler and the only difference between the two request (internal and external) is on the answer headers there is no allow-origin header when I try to call the api using domain name... Why the response header change depending of if I am internal or external?

Thanks for help :)
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900