This is the cors config
cors_config:
- maxAgeSeconds: 3600
method:
- PUT
- POST
- GET
- DELETE
- OPTIONS
origin:
- http://localhost:5216, https://myapp.web.app
responseHeader:
- image/webp
- text/plain
creation_time: 2024-11-06T15:47:28+0000
that's the error that i get
Access to fetch at 'https://storage.googleapis.com/myapp.firebasestorage.app/images/(i deleted the signed url to simplify) from origin 'https://myapp.web.app' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
dotnet.js:3
PUT https://storage.googleapis.com/legendsitaliawebapp.firebasestorage.app/images/(deleted file path to simplify) net::ERR_FAILED
Note that, before this PUT request the client also does a preflight request, and that request is accepted from the server
uploadSignedUrl | 200 | fetch | dotnet.js:3 | 997 B | 126 ms |
CORS error | fetch | dotnet.js:3 | 0 B | 2.89 s | |
200 | preflight | Preflight |
I don't know what else i could try help meeeee 😫
Solved! Go to Solution.
That was an insane mistake by me, when i followed the guide to create json file for CORS config i tought that "Content-Type" was just a placeholder and i had to write the expected content from the origin, and i wrote "image/webp" instead, that's why it wasn't working 😞
That was an insane mistake by me, when i followed the guide to create json file for CORS config i tought that "Content-Type" was just a placeholder and i had to write the expected content from the origin, and i wrote "image/webp" instead, that's why it wasn't working 😞