From 3915d21daf3b6c08f1b3a41a8315556698136afb Mon Sep 17 00:00:00 2001 From: gioboa Date: Wed, 8 Jan 2025 00:30:49 +0100 Subject: [PATCH] fix: add `/` to routeRules path --- src/core/config/resolvers/route-rules.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/config/resolvers/route-rules.ts b/src/core/config/resolvers/route-rules.ts index 2071b42ca3..86ee298b3c 100644 --- a/src/core/config/resolvers/route-rules.ts +++ b/src/core/config/resolvers/route-rules.ts @@ -17,8 +17,11 @@ export function normalizeRouteRules( config: NitroConfig ): Record { const normalizedRules: Record = {}; - for (const path in config.routeRules) { + for (let path in config.routeRules) { const routeConfig = config.routeRules[path] as NitroRouteConfig; + if (!path.startsWith('/')) { + path = `/${path}` + } const routeRules: NitroRouteRules = { ...routeConfig, redirect: undefined,