I would like to know if I can directly display an image / video and others directly via this link on my site or it poses a real security problem that we can see my cloudfare ID and the name of the bucket.
I tried to create a blob link with the Cloudflare link received but it’s impossible, I have this error:
“Access to XMLHttpRequest at ‘ID_CLOUDFARE.r2.cloudflarestorage.com/BUCKET_NAME/…’ from origin ‘mywebsite.net’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.”
is it impossible to create a blob with a cloudfare r2 link ?
For now, the only way would be a worker. See this which details a simple worker to get started, but you’d need to extend it to have proper access control and CORS headers: Get started guide · Cloudflare R2 docs