Skip to content

Add /qa-302, /qa-303, /qa-307, /qa-308, /qa-401, /qa-404, /qa-429 end… - #5

Merged
belminpre merged 1 commit into
mainfrom
qa/qa-codes-batch
Jun 11, 2026
Merged

Add /qa-302, /qa-303, /qa-307, /qa-308, /qa-401, /qa-404, /qa-429 end…#5
belminpre merged 1 commit into
mainfrom
qa/qa-codes-batch

Conversation

@belminpre

Copy link
Copy Markdown
Contributor

…points

Adds seven QA-only HTTP status endpoints alongside the existing /qa-status (200/500), /qa-301, and /qa-403. Implemented as a single parameterized Netlify Function netlify/functions/qa-code.ts which inspects the request's public path (req.url in Functions v2 reflects the original /qa-NNN, not the internal /.netlify/functions/qa-code path it was rewritten to) and emits the matching status:

/qa-302, /qa-303, /qa-307, /qa-308 -> real 3xx + Location header
(https://weirdanimals.life/)
/qa-401, /qa-404, /qa-429 -> real 4xx + text/html body
with <title> and

Parameterized over 7 separate files because the only thing that varies per code is the status number and (for 3xx) the Location header. The existing per-code files keep their dedicated handlers (qa-status has a QA_FORCE_500 env toggle that doesn't fit a generic dispatcher).

Defensive: unknown paths return 404 + plain text so misconfiguration fails loud rather than silently emitting a default status.

  • netlify/functions/qa-code.ts: new parameterized function.
  • netlify.toml: add 7 new [[redirects]] blocks (one per code), all targeting /.netlify/functions/qa-code with status = 200 (rewrite TYPE, preserves upstream status + headers). Placed between the existing /qa-403 block and the SPA /* catch-all so they are not swallowed. The existing /qa-status, /qa-301, /qa-403 functions and redirects are untouched.

No app routes, pages, or dependencies changed.

…points

Adds seven QA-only HTTP status endpoints alongside the existing
/qa-status (200/500), /qa-301, and /qa-403. Implemented as a single
parameterized Netlify Function netlify/functions/qa-code.ts which
inspects the request's public path (req.url in Functions v2 reflects
the original /qa-NNN, not the internal /.netlify/functions/qa-code
path it was rewritten to) and emits the matching status:

  /qa-302, /qa-303, /qa-307, /qa-308 -> real 3xx + Location header
                                        (https://weirdanimals.life/)
  /qa-401, /qa-404, /qa-429          -> real 4xx + text/html body
                                        with <title> and <h1>

Parameterized over 7 separate files because the only thing that varies
per code is the status number and (for 3xx) the Location header. The
existing per-code files keep their dedicated handlers (qa-status has a
QA_FORCE_500 env toggle that doesn't fit a generic dispatcher).

Defensive: unknown paths return 404 + plain text so misconfiguration
fails loud rather than silently emitting a default status.

- netlify/functions/qa-code.ts: new parameterized function.
- netlify.toml: add 7 new [[redirects]] blocks (one per code), all
  targeting /.netlify/functions/qa-code with status = 200 (rewrite
  TYPE, preserves upstream status + headers). Placed between the
  existing /qa-403 block and the SPA /* catch-all so they are not
  swallowed. The existing /qa-status, /qa-301, /qa-403 functions and
  redirects are untouched.

No app routes, pages, or dependencies changed.

Co-authored-by: Cursor <cursoragent@cursor.com>
@belminpre
belminpre merged commit 3afeebf into main Jun 11, 2026
@netlify

netlify Bot commented Jun 11, 2026

Copy link
Copy Markdown

Deploy Preview for weirdanimals ready!

Name Link
🔨 Latest commit 0664ff7
🔍 Latest deploy log https://app.netlify.com/projects/weirdanimals/deploys/6a2a7398b870a900085bacff
😎 Deploy Preview https://deploy-preview-5--weirdanimals.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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