Reputation: 10666
We made a website for another company, we have the server, they provide the hostname. There are 3 ways to access the website so far :
The website calls web services in our server (Same IP address). From the first hostname, calls to web services work with no problem because the URL is pointing on the IP address. In the second hostname I get a Cross Domain (CORS) error, because it's pointing to the second hostname and not the IP address.
Probable solution : replace IP address part on web service by the current URL
Upvotes: 1
Views: 223
Reputation: 10666
Ended up replacing the IP address in web services URLs by location.origin
. Now it's working !
Upvotes: 1