0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

fix: route matching for encoded pathnames (#9934)

Co-authored-by: Matthew Phillips <matthew@skypack.dev>
This commit is contained in:
ktym4a 2024-02-02 05:08:05 +07:00 committed by GitHub
parent 9d2fdb293d
commit b176825b34
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,5 +13,5 @@ export function matchRoute(pathname: string, manifest: ManifestData): RouteData
/** Finds all matching routes from pathname */
export function matchAllRoutes(pathname: string, manifest: ManifestData): RouteData[] {
return manifest.routes.filter((route) => route.pattern.test(pathname));
return manifest.routes.filter((route) => route.pattern.test(decodeURI(pathname)));
}