From 699740dc34cf6e1a312daa6f3eb6e9f04f1a5b4c Mon Sep 17 00:00:00 2001 From: "isNullOrEmpty()" Date: Wed, 27 Apr 2022 10:05:24 +0000 Subject: [PATCH] fix: cover edge case of script name --- pages/_middleware.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/_middleware.js b/pages/_middleware.js index 0c58633b..801fdd9c 100644 --- a/pages/_middleware.js +++ b/pages/_middleware.js @@ -6,7 +6,7 @@ function customScriptName(req) { if (scriptName) { const url = req.nextUrl.clone(); const { pathname } = url; - const names = scriptName.split(',').map(name => (name + '.js').trim()); + const names = scriptName.split(',').map(name => name.trim() + '.js'); if (names.find(name => pathname.endsWith(name))) { url.pathname = '/umami.js';