From e8e0b65186609782ee917c68f8cdb7c331f22989 Mon Sep 17 00:00:00 2001 From: TaprootFreakAI <315477232+TaprootFreakAI@users.noreply.github.com> Date: Wed, 9 Sep 2026 17:48:16 +0200 Subject: [PATCH] Revert "48a09586 - Invite and promo links answer 404 in production (#34)" This reverts commit 1555d9346a845a7442fe8df9b2a43628f04d5b3e. --- CONTRIBUTING.md | 42 +- README.md | 16 +- functions/_middleware.js | 251 +-------- functions/lib/itunes-banner.js | 51 -- test/itunes-banner-function.test.mjs | 84 +-- test/middleware.test.mjs | 781 --------------------------- vitest.config.mjs | 20 +- 7 files changed, 36 insertions(+), 1209 deletions(-) delete mode 100644 test/middleware.test.mjs diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 63a43a8..d2719b1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,16 +9,8 @@ This repo is the **realunit.app** website — public, static. See the `public/` ships verbatim to Cloudflare Pages — what you commit is what gets served. The one exception is the invite/promo HTML: `functions/_middleware.js` rewrites those bytes on the way out so crawlers see the code in - `apple-itunes-app`, `og:*` and the App Links before any script runs. It also - reports a rewritten landing as `200`: Pages resolves `/invite/` to the - code-less shell through the `_redirects` rewrite but keeps the not-found - status of the path that was asked for, and a crawler drops a `404` before it - reads the tags. The promotion is guarded on the two landing marks — `id="state-loading"` and `aria-busy="true"`, which both landings carry together in one tag and no other page the site ships carries together — so the site's - own 404 page keeps saying 404, and HEAD answers with the same status as GET. - Both methods are resolved internally as one full GET, without `Range` / - `If-Range` and without the conditional request headers, because the whole document - is rewritten and the status is decided from its body. The conditional request headers are dropped rather than evaluated, which is a deliberate deviation from RFC 9110 §13.1: a rewritten landing emits no validator to condition on, so the answer is always the current representation and never a 304 or a 412. A pass-through answer keeps the origin's own headers, validator included. `scripts/dev-server.mjs` shares the injection and answers HEAD without a body, but has no promotion, no marker guard and no header stripping: its own routing serves the landings as `200` and never produces the not-found status the promotion exists to correct. Nothing else is transformed, and there is no server-side - rendering. The dev dependencies exist **only** for the quality gates below + `apple-itunes-app`, `og:*` and the App Links before any script runs. Nothing + else is transformed, and there is no server-side rendering. The dev dependencies exist **only** for the quality gates below (formatting, HTML validation, unit tests, screenshots); nothing compiles or bundles the site. - **Invite/promo HTML rewrite is banner, canonical, and store handoff.** Safari, @@ -53,9 +45,8 @@ This repo is the **realunit.app** website — public, static. See the adding any other host to that allowlist needs a reason in the PR. - Inline `style="…"` attributes and `