From 3806e78b157d312e4ef2311e8c1fdcb6f2e8236b Mon Sep 17 00:00:00 2001 From: pfans Date: Mon, 9 Oct 2023 01:08:15 -0500 Subject: [PATCH] Allow setting empty path in url rewrite. (#66) --- pjs/filter/url-rewrite.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pjs/filter/url-rewrite.js b/pjs/filter/url-rewrite.js index 173734e..5ba916f 100644 --- a/pjs/filter/url-rewrite.js +++ b/pjs/filter/url-rewrite.js @@ -31,7 +31,7 @@ makeHeadHandler = (path, cfg) => ( (cfg?.Path?.Type === 'ReplacePrefixMatch') ? ( - cfg?.Path?.ReplacePrefixMatch && ( + (cfg?.Path?.ReplacePrefixMatch !== undefined) && ( head => ( head?.path?.length > path.length ? ( head.path = resolvPath(cfg.Path.ReplacePrefixMatch) + head.path.substring(path.length) @@ -45,7 +45,7 @@ ) ) : ( (cfg?.Path?.Type === 'ReplaceFullPath') ? ( - cfg?.Path?.ReplaceFullPath && ( + (cfg?.Path?.ReplaceFullPath !== undefined) && ( head => ( ( prefix = (head?.path || '').split('?')[0],