R2 storage access throught public custom domain

I read the docs, but I just cannot figure out why, I cannot make the R2 storage to be accessable via my public custom domain I set. I tried to have the public dev enabled too, but they just blocked somehow. Even created another bucket and set a custom domain. It just cannot work. What should I try?
7 Replies
Cvikli | TODO for AI
Also accessing via the xxxxx.r2.cloudflarestorage.com/edge it writes: This XML file does not appear to have any style information associated with it. The document tree is shown below. <Error> <Code>InvalidArgument</Code> <Message>Authorization</Message> </Error>
harshil1712
harshil17124mo ago
Did you set the correct CORS policy?
Cvikli | TODO for AI
not sure, what do I have o set? I am opening it from a browser.
harshil1712
harshil17123mo ago
?cors
SuperHelpflare
SuperHelpflare3mo ago
CORS is a method of ensuring any request made from a browser to a backend is allowed to be read in the browser. To use CORS: - Have your backend reply to every OPTIONS request with a status code of 204, an empty body, and a header of Access-Control-Allow-Origin and a value of *. - Additionally, if you wish to make POST requests you also need to add a header to the OPTIONS reply of Access-Control-Allow-Methods and a value of POST. Then, you need to reply with the same headers on the actual response to the POST, even if it's a 404 or 403 response. This ensures the browser knows it is allowed to read the POST response or failure response.
harshil1712
harshil17123mo ago
Do you see any logs in the console?
Cvikli | TODO for AI
Failed to load resource: the server responded with a status of 400 (Bad Request) TypeError: Cannot use 'in' operator to search for 'animation' in undefined at Jr (user-provider-7689d26c.js:46:29194) at user-provider-7689d26c.js:46:29234 edge:1

Failed to load resource: the server responded with a status of 400 (Bad Request) ok, I think we can let it go. We won't use it via this link. We will use direct link to the files... and that's it

Did you find this page helpful?