From ba835a7ee2b57728c6843336c1bd79ddabeda8a9 Mon Sep 17 00:00:00 2001 From: Daniel Lando Date: Thu, 5 Oct 2023 10:08:54 +0200 Subject: [PATCH] fix: issue when header not present in request cc @kpine --- app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.ts b/app.ts index a507fbb88d..8d31703eaf 100644 --- a/app.ts +++ b/app.ts @@ -554,7 +554,7 @@ const redirectPaths = [ app.use('/', (req, res, next) => { if (redirectPaths.includes(req.originalUrl)) { // get path when running behind a proxy - const path = req.header('X-External-Path').replace(/\/$/, '') + const path = req.header('X-External-Path')?.replace(/\/$/, '') ?? '' res.redirect(`${path}/#${req.originalUrl}`) } else {