From db1da9f3c61bf578daa284676ac9cd11ed112c51 Mon Sep 17 00:00:00 2001 From: levensta Date: Sun, 24 Sep 2023 22:08:46 +0300 Subject: [PATCH] lazy evaluation --- lib/url-sanitizer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/url-sanitizer.js b/lib/url-sanitizer.js index 9accd40..8852f9f 100644 --- a/lib/url-sanitizer.js +++ b/lib/url-sanitizer.js @@ -62,7 +62,7 @@ function safeDecodeURI (path, useSemicolonDelimiter) { // Some systems do not follow RFC and separate the path and query // string with a `;` character (code 59), e.g. `/foo;jsessionid=123456`. // Thus, we need to split on `;` as well as `?` and `#` if the useSemicolonDelimiter option is enabled. - } else if (charCode === 63 || charCode === 35 || (useSemicolonDelimiter && charCode === 59)) { + } else if (charCode === 63 || charCode === 35 || (charCode === 59 && useSemicolonDelimiter)) { querystring = path.slice(i + 1) path = path.slice(0, i) break