astro@5.11.0
Minor Changes
-
#13972
db8f8be
Thanks @ematipico! - Updates theNodeApp.match()
function in the Adapter API to accept a second, optional parameter to allow adapter authors to add headers to static, prerendered pages.NodeApp.match(request)
currently checks whether there is a route that matches the givenRequest
. If there is a prerendered route, the function returnsundefined
, because static routes are already rendered and their headers cannot be updated.When the new, optional boolean parameter is passed (e.g.
NodeApp.match(request, true)
), Astro will return the first matched route, even when it's a prerendered route. This allows your adapter to now access static routes and provides the opportunity to set headers for these pages, for example, to implement a Content Security Policy (CSP).
Patch Changes
-
#14029
42562f9
Thanks @ematipico! - Fixes a bug where server islands wouldn't be correctly rendered when they are rendered inside fragments.Now the following examples work as expected:
Not working--- import { Cart } from '../components/Cart.astro'; --- <> <Cart server:defer /> > <Fragment slot="rest"> <Cart server:defer> <div slot="fallback">Not workingdiv> Cart> Fragment>
-
#14017
8d238bc
Thanks @dmgawel! - Fixes a bug where i18n fallback rewrites didn't work in dynamic pages.