Skip to content

Add /qa-403 Netlify function for Prerender 4xx testing - #4

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

Add /qa-403 Netlify function for Prerender 4xx testing#4
belminpre merged 1 commit into
mainfrom
qa/qa-403

Conversation

@belminpre

Copy link
Copy Markdown
Contributor

A third QA-only endpoint alongside /qa-status and /qa-301. Always returns a real HTTP 403 with Content-Type: text/html; charset=utf-8 and a minimal HTML body (<title>403 - QA</title>,

Forbidden

). Used to test Prerender's handling of 4xx responses on a clean, page-looking URL.

  • netlify/functions/qa-403.ts: new function returning 403 + HTML body.
  • netlify.toml: add /qa-403 -> /.netlify/functions/qa-403 rewrite. The status = 200 here is the rewrite TYPE (proxy), not a forced response code — Netlify preserves the function's 403 status and Content-Type through the rewrite. Placed between the existing /qa-301 rewrite and the SPA /* catch-all so it is not swallowed. The existing /qa-status and /qa-301 rewrites and functions are untouched.

No app routes, pages, or dependencies changed.

A third QA-only endpoint alongside /qa-status and /qa-301. Always
returns a real HTTP 403 with Content-Type: text/html; charset=utf-8
and a minimal HTML body (<title>403 - QA</title>, <h1>Forbidden</h1>).
Used to test Prerender's handling of 4xx responses on a clean,
page-looking URL.

- netlify/functions/qa-403.ts: new function returning 403 + HTML body.
- netlify.toml: add /qa-403 -> /.netlify/functions/qa-403 rewrite. The
  status = 200 here is the rewrite TYPE (proxy), not a forced response
  code — Netlify preserves the function's 403 status and Content-Type
  through the rewrite. Placed between the existing /qa-301 rewrite and
  the SPA /* catch-all so it is not swallowed. The existing /qa-status
  and /qa-301 rewrites and functions are untouched.

No app routes, pages, or dependencies changed.

Co-authored-by: Cursor <cursoragent@cursor.com>
@netlify

netlify Bot commented Jun 11, 2026

Copy link
Copy Markdown

Deploy Preview for weirdanimals ready!

Name Link
🔨 Latest commit 5cf431e
🔍 Latest deploy log https://app.netlify.com/projects/weirdanimals/deploys/6a2a63cfc7bc330008fa8994
😎 Deploy Preview https://deploy-preview-4--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.

@belminpre
belminpre merged commit 7052884 into main Jun 11, 2026
4 of 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