Cross-Origin Request Blocked when embedding own content? #240
-
Hello, I stumbled upon Voyager when looking for open-source ways to make 3d scans viewable within web browsers, and was impressed with how user-friendly this looks. I attempted to follow the directions to display my own content in the Explorer component, on a server I have access to. I think I have the svx.json and glb files saved correctly (I can access them publicly via a direct URL) - but unfortunately, the browser doesn't load the files within the Voyager viewer, and the developer console shows the following error: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://sites.pfw.edu/wehl/sites/3d/bowl/bowl2.svx.json. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200. Before I follow up with my campus IT (maybe this is something they have to adjust on the server?), I wanted to make sure that there wasn't anything I messed when setting up the Voyager files. Has anything like this happened to other institutions trying to display their own files? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @pfw-fredricg , You've likely set up Voyager correctly, this is a more general issue with web security. Are your resources (svx file, models) hosted on the same web server as your .html? If that's a possibility to do, you should be good to go. Is this a page that is publicly viewable? |
Beta Was this translation helpful? Give feedback.
-
Thank you, Jamie! I had been viewing the code from either our web CMS pages or from a locally saved HTML file. Saving the HTML to the same web server solved the cross origin issue. |
Beta Was this translation helpful? Give feedback.
Hi @pfw-fredricg ,
You've likely set up Voyager correctly, this is a more general issue with web security.
Are your resources (svx file, models) hosted on the same web server as your .html? If that's a possibility to do, you should be good to go. Is this a page that is publicly viewable?