Access to XMLHttpRequest at '' from origin '' has been blocked by CORS policy

Hello I’m using this example
here
in my Laravel app to view 3d models
I’m using google storage as storage of my app and I put the file DamagedHelmet.gltf in it
I all rest code in my laravel app but I sucked in
"Blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource"
I configured google storage as described here : cors in google storage
any solution for that?

You can easily check via the Chrome Dev Tools (Network Tab) if the CORS header is actually missing. If so, your server-side configuration is obviously wrong.

Can you show me what you mean via images ?

It should look like so:

Notice the CORS header (access-control-allow-origin: *) in the “Response Headers” section.

This what I got

Um, the screenshot does not show the response header.

This only what I get from the request.
I put the file in a shared host not google storage and I get the same problem.

Sorry, I’m not familiar with Google Cloud Storage. Have you considered to ask a question at the GCP community?

1 Like

Thanks
I solved it by using

https://[BUCKET_NAME].storage.googleapis.com

instead of

https://storage.cloud.google.com/[BUCKET_NAME]

Source

2 Likes