Skip to content

Add /qa-301 Netlify function for Prerender 3xx testing - #3

Merged
belminpre merged 1 commit into
mainfrom
qa/qa-301
Jun 9, 2026
Merged

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

Conversation

@belminpre

Copy link
Copy Markdown
Contributor

A second QA-only endpoint alongside /qa-status. Always returns a real HTTP 301 with Location: https://weirdanimals.life/, set by the function itself. Used to test Prerender's handling of 3xx responses on a clean, page-looking URL.

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

No app routes, pages, or dependencies changed.

A second QA-only endpoint alongside /qa-status. Always returns a real
HTTP 301 with Location: https://weirdanimals.life/, set by the function
itself. Used to test Prerender's handling of 3xx responses on a clean,
page-looking URL.

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

No app routes, pages, or dependencies changed.

Co-authored-by: Cursor <cursoragent@cursor.com>
@belminpre
belminpre merged commit 90e2b11 into main Jun 9, 2026
1 check passed
@netlify

netlify Bot commented Jun 9, 2026

Copy link
Copy Markdown

Deploy Preview for weirdanimals ready!

Name Link
🔨 Latest commit 292775c
🔍 Latest deploy log https://app.netlify.com/projects/weirdanimals/deploys/6a286b73ae1cd50008c1d47a
😎 Deploy Preview https://deploy-preview-3--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