add r2 public bucket local support#31767
Conversation
Review
Code ReviewThis code review is in beta and may not always be helpful — use your judgment. No code review issues found. ConventionsChecks PR title, description, and redirect checklist. No convention issues found. Style Guide ReviewWarnings (1)
RedirectsNo missing redirect entries found. CommandsOnly codeowners can run commands. Post a comment with the command to trigger it.
|
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
There was a problem hiding this comment.
Summary
This PR adds a concise Local development section to the R2 public-buckets documentation, covering the local-only path format, binding behavior, supported HTTP methods, and a caveat about public-access availability.
Changes
- Adds 8 lines under a new
## Local developmentheading insrc/content/docs/r2/buckets/public-buckets.mdx. - Links to the existing
/workers/local-developmentpage. - References the upstream wrangler change (cloudflare/workers-sdk#14119).
Issues flagged
- Missing trailing newline – the file currently ends without a newline (
\ No newline at end of file). Please ensure the file ends with a newline. - Variable placeholder casing – style guide requires
ALL_CAPS_UNDERSCORESfor placeholders (e.g.,<BUCKET_ID>rather than<bucket-id>). - Filler words / prose tightening – the closing sentence contains filler words (“or not”, “actually”, “in fact”) that can be removed for clarity.
- Ambiguous list structure – the sentence describing endpoint capabilities could be misread; consider splitting it.
None of these are blockers, but addressing them will bring the page in line with the docs style guide.
|
|
||
| ## Local development | ||
|
|
||
| When [developing locally](/workers/local-development), objects are served under `/cdn-cgi/local/r2/public/<bucket-id>/<key>`, where `<bucket-id>` is the bucket's `bucket_name` as set in your Wrangler config. If `bucket_name` is not set, this is the `binding` name. |
There was a problem hiding this comment.
Style guide: variable placeholders should use ALL_CAPS_UNDERSCORES inside angle brackets.
Please change:
<bucket-id>→<BUCKET_ID><key>→<KEY>(or<OBJECT_KEY>)
|
|
||
| When [developing locally](/workers/local-development), objects are served under `/cdn-cgi/local/r2/public/<bucket-id>/<key>`, where `<bucket-id>` is the bucket's `bucket_name` as set in your Wrangler config. If `bucket_name` is not set, this is the `binding` name. | ||
|
|
||
| Bindings configured with `remote: true` are not exposed. The endpoint supports `GET` and `HEAD`, range requests, conditional headers, and forwards stored HTTP metadata. |
There was a problem hiding this comment.
This list reads a little ambiguously — it sounds like the endpoint “supports … forwards stored HTTP metadata.” Consider splitting the sentence for clarity:
The endpoint supports
GETandHEAD, range requests, and conditional headers. It also forwards stored HTTP metadata.
|
|
||
| Bindings configured with `remote: true` are not exposed. The endpoint supports `GET` and `HEAD`, range requests, conditional headers, and forwards stored HTTP metadata. | ||
|
|
||
| Note this is always available locally, regardless of whether or not you have actually enabled public access for this bucket. Recall that by default, buckets are in fact _not_ publicly accessible over the Internet. No newline at end of file |
There was a problem hiding this comment.
Consider tightening this to remove filler words and improve readability:
Note that this endpoint is always available locally, regardless of whether you have enabled public access for the bucket. By default, buckets are not publicly accessible over the Internet.
(You could also wrap this in a :::note admonition since it is supplementary info.)
|
Review completed for PR #31767
What the PR changesAdds a new Local development section (8 lines) to Issues flagged
Inline suggestions posted
No blockers were identified; addressing the style points should make this ready to merge. |
|
Preview URL: https://77bb608d.preview.developers.cloudflare.com Files with changes (up to 15)
|
MattieTK
left a comment
There was a problem hiding this comment.
Thanks for doing this Emily, a few minor nits from the reviewer that I think are useful in condensing the language.
|
|
||
| Bindings configured with `remote: true` are not exposed. The endpoint supports `GET` and `HEAD`, range requests, conditional headers, and forwards stored HTTP metadata. | ||
|
|
||
| Note this is always available locally, regardless of whether or not you have actually enabled public access for this bucket. Recall that by default, buckets are in fact _not_ publicly accessible over the Internet. No newline at end of file |
Summary
this was recently added to wrangler: cloudflare/workers-sdk#14119