Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

Redirection Cross-Origin from googleapis to vrassets #9

Open
ThibaultAr opened this issue Apr 5, 2018 · 2 comments
Open

Redirection Cross-Origin from googleapis to vrassets #9

ThibaultAr opened this issue Apr 5, 2018 · 2 comments

Comments

@ThibaultAr
Copy link

Hello Google Team,

We experience issues with the Web samples of Poly API : Today, the search sample is not working anymore because of this issue :

7:1 Failed to load https://poly.googleapis.com/downloads/6XXj6DSBb08/dH3skx1SVUc/materials.mtl: Redirect from 'https://poly.googleapis.com/downloads/6XXj6DSBb08/dH3skx1SVUc/materials.mtl' to 'https://vrassets-pa.googleusercontent.com/downloads/6XXj6DSBb08/dH3skx1SVUc/materials.mtl' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost/workspace' is therefore not allowed access.

We have currently hot fixed the problem by replacing the request URL of the MTL/OBJ Loader in the script.

Regards

@georgeawwad
Copy link

georgeawwad commented Apr 6, 2018

I am currently dealing with a similar issue and have been unable to find a fix.

Edit: Ok my solution - I ended up setting up a proxy for https://poly.googleapis.com on my devServer and I'm splitting the response url before passing to the MTL and OBJ loaders.

const proxy = '/api/downloads'
const mtlAsset = proxy + mtl.url.split('downloads')[1]
const objAsset = proxy + obj.url.split('downloads')[1]

And now everything is good.

@mrdoob
Copy link
Contributor

mrdoob commented Apr 27, 2018

/ping @ianmacgillivray

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants