What version of astro are you using?
2.10.9
Are you using an SSR adapter? If so, which one?
Node
What package manager are you using?
npm
What operating system are you using?
Mac
What browser are you using?
Chrome
Describe the Bug
In the past, with an older version of Astro (until 2.8.4), it was feasible to generate Responses bearing the 404 status code. However, in the current setup (version 2.9.0 and above), this process triggers an infinite loop due to Astro's subsequent search for the missing /404.astro page. To circumvent this loop, I opt not to furnish a /404.astro page. This choice stems from my desire to refrain from redirecting users to a dedicated 404 page. Instead, I intend to furnish a 404 Code directly while retaining the requested URL's context.
return new Response("custom 404 html content", {
status: 404
});
What's the expected result?
I would expect to be able to return any page with a 404 code.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/stackblitz-starters-6pmtt6?file=response-with-404-code%2Fsrc%2Fpages%2F[...path].astro
Participation
What version of
astroare you using?2.10.9
Are you using an SSR adapter? If so, which one?
Node
What package manager are you using?
npm
What operating system are you using?
Mac
What browser are you using?
Chrome
Describe the Bug
In the past, with an older version of Astro (until 2.8.4), it was feasible to generate Responses bearing the 404 status code. However, in the current setup (version 2.9.0 and above), this process triggers an infinite loop due to Astro's subsequent search for the missing /404.astro page. To circumvent this loop, I opt not to furnish a /404.astro page. This choice stems from my desire to refrain from redirecting users to a dedicated 404 page. Instead, I intend to furnish a 404 Code directly while retaining the requested URL's context.
What's the expected result?
I would expect to be able to return any page with a 404 code.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/stackblitz-starters-6pmtt6?file=response-with-404-code%2Fsrc%2Fpages%2F[...path].astro
Participation