Skip to content

About

Minimal reproduction: astro/hono pages() returns X-Astro-Error for a prerendered 404.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Prerendered 404 leaks X-Astro-Error on a worker entry

[email protected], @astrojs/[email protected] (next @ 3cf4719924).

FetchState uses an SSR /404 as routeData. A prerendered /404 stays unset. pages() then returns status 404, a null body, and X-Astro-Error: true. App.render deletes that header and calls renderError.

The default Cloudflare worker calls app.render(). This worker does not. cf() copies cookies and CDN cache headers only. astro dev uses the configured worker entrypoint, so the header is on the response there too.

Without a user-authored 404.astro, Astro injects an SSR 404 and pages() renders it. This project prerenders src/pages/404.astro.

Observed

GET /missing is 404. The body is empty. X-Astro-Error is true. The body does not contain PRERENDERED-404.

Control

astro() after cf() serves the prerendered HTML through prerenderedErrorPageFetch and omits the header.

About

Minimal reproduction: astro/hono pages() returns X-Astro-Error for a prerendered 404.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages