You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Updating a page meant deleting it and re-creating it under the same name. Add PUT /api/pages/:slug, which replaces an existing page's content while keeping its URL, owner, trust flag, and created_at. Authorized to owner-or-admin (core::origin::can_replace, same rule as delete) *and* can_upload, so a revoked uploader can't keep pushing content to pages they already own. The replace can't roll back the way create does — R2 has no multi-object transaction and the previous bytes aren't retained — so the ordering bounds the damage instead: new objects are written before any old key is deleted (a viewer mid-update sees old-or-new per file, never a blank page), stale keys are pruned last and best-effort (a failure only orphans an object), and the D1 stats are refreshed only once R2 succeeds. Design §4.6b covers the reasoning; §5's "no page overwrite" scope cut is retired. In the UI, the always-visible upload card becomes a modal driven by two entry points: "+ New Page" (create) and a per-row "Update" (replace, with the slug pre-filled and read-only). Verified end to end against wrangler dev with local D1/R2 — create, serve, replace, stale assets pruned, stats/trust/ownership preserved, plus the 401/403/404/400/413 paths — and the UI driven in jsdom (37 assertions). 152 unit + 19 doctests, both-target clippy clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
1 week ago | |
|---|---|---|
| .. | ||
| pages-77lk--pages-static-site-host-on-cloudflare-v0.md | 1 week ago | |
| pages-adl9--page-content-serving-from-r2.md | 1 week ago | |
| pages-ihlp--opentofu-infra-deployment-docs-project-docs-polish.md | 1 week ago | |
| pages-jaqz--embedded-management-ui-staticindexhtml.md | 1 week ago | |
| pages-jgc4--d1-schema-and-query-layer.md | 1 week ago | |
| pages-kns6--pages-and-users-json-api.md | 1 week ago | |
| pages-lxjz--scaffold-worker-crate-hello-world-builds.md | 1 week ago | |
| pages-saom--core-policy-modules-slug-mime-upload-validation-he.md | 1 week ago | |
| pages-shqc--per-page-and-per-user-trust-opt-out-of-csp-sandbox.md | 1 week ago | |
| pages-ytau--update-a-page-in-place-re-upload-content-put-apipa.md | 1 week ago | |
| pages-zd46--github-oauth-sessions-auth-middleware.md | 1 week ago | |