4 Replies
will create a thread so we can keep the channel tidy.
I was able to replicate the CORS error that you saw. However, at least in my case, a 403 also happened and, as you mentioned, removing the hash sums validations, it gets resolved.
So yes, you do get an error when there is a hash mismatch, but it seems that the response might be missing some CORS headers that would allow you to see it in a normal response.
I can suggest wrapping the fetch within a try/catch block so you can define what to do if these requests fail.
I'll also ask internally on why these errors don't seem to have the same
Access-Control-Allow-Origin
as the Bucket's CORS policyThank you for getting back to me on this, and for asking internally about CORS for the errors. I'll definitely wrap the requests in try/catch blocks too, but in this case, I think checking
res.ok
is also a good idea since I don't believe the request actually throws in case of a 403fetch
can throw exceptions
(https://developer.mozilla.org/en-US/docs/Web/API/fetch#exceptions)
you can reproduce it running the following code:
But yes, it's just a suggestion (:wat, TIL ! thank you 🙂