Sosmosis
CDCloudflare Developers
•Created by Sosmosis on 1/30/2025 in #general-help
CORS Issue with localhost
I have my R2 bucket configured as follows:
[
{
"AllowedOrigins": [
"http://localhost:3000",
"http://localhost:3010",
"{MY_EXTERNAL_SITE}"
],
"AllowedMethods": [
"GET",
"POST",
"PUT"
],
"AllowedHeaders": [
"*"
]
}
]
But I still get this error when trying to access R2 images from my dev environment. I get no errors with {MY_EXTERNAL_SITE}
Access to image at '{IMG_URL} from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
What's going on? The fact that {MY_EXTERNAL_SITE} works means the configuration is successfully in place
5 replies