From ea3df041c19e388ee96fd965cef0946467068cc4 Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Fri, 4 Oct 2024 05:15:43 +0200 Subject: [PATCH] Fix: prepare URLPattern spec change (#2676) Fixes https://github.com/denoland/fresh/issues/2627 --- src/router.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/router.ts b/src/router.ts index 4d1c7772f27..f8b7a55006e 100644 --- a/src/router.ts +++ b/src/router.ts @@ -113,9 +113,7 @@ export class UrlPatternRouter implements Router { // Decode matched params for (const [key, value] of Object.entries(match.pathname.groups)) { - if (value !== undefined) { - result.params[key] = decodeURI(value); - } + result.params[key] = value === undefined ? "" : decodeURI(value); } if (route.method === "ALL") {