R2 CORS help

Hi,

I started to experiment with R2 but I started to do so at the beginning of this recent cloudflare problems so I am not sure if I am doing something wrong or is it connected with that problems.

So, I have custom domain custom.com which I connected to my R2 bucket.

Now I want to access content in that bucket from domain mydomain.com but all the time I get

Access to XMLHttpRequest at ‘https://custom.com/scifi_girl_v.glb’ from origin ‘https://mydomain.com’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

and my CORSC policy is:

[
  {
    "AllowedOrigins": [
      "http://localhost:3000",
      "https://mydomain.com"
    ],
    "AllowedMethods": [
      "GET",
      "POST",
      "HEAD"
    ]
  }
]

I put everything there because I am not sure what I am doing. I even tested with “*” in the allowedOrigins but without luck.

I put header in request from mydomain.com which says “Origin: https://mydomain.com” but it seems that R2 never respond with header from which my browser could detect that cross origin is allowed.

For two days I can’t figure out what is wrong.