From 138ca361de5d25eba6ddd6286da64032ffceb256 Mon Sep 17 00:00:00 2001 From: IrosTheBeggar Date: Wed, 16 Jun 2021 23:43:54 -0400 Subject: [PATCH] remove another line of code with too new features --- src/server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server.js b/src/server.js index da5a0fb..e89ebd8 100644 --- a/src/server.js +++ b/src/server.js @@ -77,7 +77,7 @@ exports.serveIt = async configFile => { if (req.path.endsWith('//')) { // find all trailing slashes at the end of the url const matchEnd = req.path.match(/(\/)+$/g); - const queryString = req.url.match(/(\?.*)/g) ?? ''; + const queryString = req.url.match(/(\?.*)/g) === null ? '' : req.url.match(/(\?.*)/g); // redirect to a more sane URL return res.redirect(301, req.path.slice(0, (matchEnd[0].length - 1)*-1) + queryString); }