With the CORS extension, I could avoid the issue to fetch the data from ShapeDiver server, but without it, I cannot successfully fetch the data.
Is it related with the following change across Chromium projects?
I tried to find a way which is proper way to handle it, such as editing the code as recommended, but ShapeDiver API request is done in new SDVApp.ParametricViewer(settings).
I could not dig in the request, such as editing the Request headers… Is there any way to edit the API request more in detail, rather than change the parameter through settings?
I hope it is clear for you to understand the issue.
We don’t allow port 8000 in general, 8080 should work. If you are trying to embed a model you also need set up domains correctly, similar issue has been resolved in this Forum post:
More on whitelisting domains in the Documentation:
Regarding whitelist, I was already aware of it, so, anytime I use ShapeDiver API, I added the domain name with/without port number in the list. So, it does not help this issue neither.
However, I have installed allow CORS policy in the Browser, and it solved the issue. But it is not desirable because it relies on external Extension for using API.
Is there any other suggestion to solve this CORS issue in better way?
You don’t need any extensions to embed ShapeDiver models successfully. Can you double-check that:
You set up the global domains correctly
You enabled them in model settings
We allow port 8080 for local testing and it should just work. Could you give me more details what are you trying to do? Link to your model and web site where you want to embed it would help a lot.
Okay, I set up the global domains correctly. That is why how I can see the model successfully with Extension, which is mentioned in the earlier post.
From localhost, port 8080, 8000 both worked. But I host the application in AWS instance and I accessed it via URL of this instance, I could not get data via Shape Diver API. The web application is perfectly loaded and could see it, but the ShapeDiver viewer part is still loading and cannot fetch data.
More precisely, access to AWS instance → Nginx (Docker container) → Node JS Application(Docker container) calls Shape Diver API. Again, this worked in localhost environment. And it works with allow CORS extension. It cannot fetch data in AWS instance.
We have configured CORS to allow the loopback address (127.0.0.1) for local testing, but general IP addresses are not allowed. Please use a hostname which resolves to your IP address.
What do you mean with “Please use a hostname which resolves to your IP address”?
Once I map this IP address to domain name, it will be allowed again? Or Is there certain range of IP address which are allowed for ShapeDiver API, except (127.0.0.1)?