Skip to content

Commit a6ab65a

Browse files
authored
fix: cloudflare in cloud-storage.md (#105)
1 parent c224764 commit a6ab65a

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

pmtiles/cloud-storage.md

+10-12
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,24 @@ Storage services usually bill by number of GET requests and the total number of
4040

4141
* R2 supports HTTP/2.
4242

43-
* R2 CORS can be configured through a command-line utility, like the `aws` tool, or from your S2 bucket's "Settings" tab's "CORS Policy" section:
43+
* R2 CORS can be configured through a command-line utility, like the `wrangler` tool, or from your Cloudflare R2 bucket's "Settings" tab's "CORS Policy" section:
4444

4545
```json title="cors_rules.json"
4646
{
47-
"CORSRules": [
48-
{
49-
"AllowedOrigins": ["https://example.com"],
50-
"AllowedMethods": ["GET","HEAD"],
51-
"AllowedHeaders": ["range","if-match"],
52-
"ExposeHeaders": ["etag"],
53-
"MaxAgeSeconds": 3000
54-
}
55-
]
47+
"allowed": {
48+
"origins": ["https://example.com"],
49+
"methods": ["GET","HEAD"],
50+
"headers": ["range","if-match"],
51+
},
52+
"exposeHeaders": ["etag"],
53+
"maxAgeSeconds": 3000
5654
}
5755
```
5856

59-
Example of using the `aws` command line tool to configure R2 CORS:
57+
Example of using the `wrangler` command line tool to configure R2 CORS:
6058

6159
```
62-
aws s3api put-bucket-cors --bucket MY_BUCKET --cors-configuration file:///home/user/cors_rules.json --endpoint-url https://S3_COMPATIBLE_ENDPOINT
60+
wrangler r2 bucket cors set MY_BUCKET --file file:///home/user/cors_rules.json
6361
```
6462

6563
### Amazon S3

0 commit comments

Comments
 (0)