R2 seems to be ignoring the CORS policy
I have a bucket that i'm trying to upload to via signed URLs generated using aws-sdk Node package
The signed URL always fails PUT request with
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Here's my CORS policy, which should work? What am I missing?
6 Replies
Cloudflare Docs
Troubleshooting · Cloudflare R2 docs
If you are encountering a CORS error despite setting up everything correctly, you may follow this troubleshooting guide to help you.
i've seen this + multiple forums post, no dice
Do you have a repro somewhere I can test with?
not at the moment, it's rather painful to extract from the main project ðŸ«
Can you copy just the part that does the signature? I can try to start from there at least
oh i think i fixed it, changed
AllowedHeaders
to
and now it's a 403 instead of preflight error, so i can at least debug further 😄
nvm still same issue
one sec
Tried rotating the keys and every variation of the policy JSON i can think of, still getting the No 'Access-Control-Allow-Origin' header is present on the requested resource.
Tried console.log(await s3Client.send(new ListBucketsCommand({})))
from the examples, got an error
Changed the api token from object to admin
Managed to list
Changed it back
Managed to upload one time
Repeated the upload - 403
The good news is cors seems solved, the bad news is the inconsistent 403