From 0181d3344a5fe56929ae584a065dc7d001ad3d97 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Mon, 31 Jul 2023 12:25:56 +0200 Subject: [PATCH] fix(getRequestPath): avoid double normalization --- src/utils/request.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/request.ts b/src/utils/request.ts index c8be0b02..65cdc1b9 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -130,7 +130,7 @@ export function getRequestProtocol( const DOUBLE_SLASH_RE = /[/\\]{2,}/g; export function getRequestPath(event: H3Event): string { - const path = event._originalPath.replace(DOUBLE_SLASH_RE, "/"); + const path = event._originalPath; if (path.includes("?")) { const [basePath, query] = path.split("?"); return basePath.replace(DOUBLE_SLASH_RE, "/") + "?" + query;