SirTheo
SirTheo
CDCloudflare Developers
Created by teena on 11/12/2024 in #r2
CORS issues when downloading files from R2
so: 1. Go to Rules → Transform Rules in the Cloudflare panel. 2. Add a new transform rule with these conditions: - When incoming requests match: Specify your domain (e.g. assets.mydomain.com) and path (e.g. *.png). 3. Action: Modify Response Header: - Set Header: - Access-Control-Allow-Origin: * or https://assets.mydomain.com - Access-Control-Allow-Methods: GET, HEAD - Access-Control-Allow-Headers: *
3 replies
CDCloudflare Developers
Created by teena on 11/12/2024 in #r2
CORS issues when downloading files from R2
[
{
"AllowedHeaders": ["*"],
"AllowedMethods": ["GET", "HEAD", "PUT", "POST"],
"AllowedOrigins": ["https://assets.mydomain.com"],
"ExposeHeaders": ["ETag"],
"MaxAgeSeconds": 3000
}
]
[
{
"AllowedHeaders": ["*"],
"AllowedMethods": ["GET", "HEAD", "PUT", "POST"],
"AllowedOrigins": ["https://assets.mydomain.com"],
"ExposeHeaders": ["ETag"],
"MaxAgeSeconds": 3000
}
]
3 replies
CDCloudflare Developers
Created by teena on 11/12/2024 in #r2
CORS issues when downloading files from R2
can you send a snipped copy of your cors?
3 replies