Skip to content

[codex] Route R2 packs through the Pages origin - #15

Merged
cla7aye15I4nd merged 1 commit into
mainfrom
codex/pages-r2-route
Jul 6, 2026
Merged

[codex] Route R2 packs through the Pages origin#15
cla7aye15I4nd merged 1 commit into
mainfrom
codex/pages-r2-route

Conversation

@cla7aye15I4nd

Copy link
Copy Markdown
Owner

What changed

  • serve the static browser, catalog, and manifests from Cloudflare Pages again
  • route /data/* through a minimal Worker with an R2 binding
  • write same-origin /data/generated/.../data.pack URLs into every manifest
  • preserve byte-range responses and restrict the Worker to immutable pack paths
  • deploy R2 packs, the Worker route, then the Pages site in that order

Why

R2 custom domains do not provide Pages-style index handling. Keeping the shell on Pages and mounting R2 at a same-origin path avoids the root redirect rule, the second Access authentication, and CORS while retaining packed source storage.

Validation

  • node --test worker/r2-data.test.mjs
  • wrangler deploy --dry-run
  • actionlint
  • cargo fmt --all -- --check
  • cargo test --locked --workspace --all-targets
  • cargo clippy --locked --workspace --all-targets -- -D warnings

@cla7aye15I4nd
cla7aye15I4nd marked this pull request as ready for review July 6, 2026 06:52
@cla7aye15I4nd
cla7aye15I4nd merged commit f6d679f into main Jul 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant