Skip to content

Commit

Permalink
fix: issue when header not present in request
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Oct 5, 2023
1 parent a13d26f commit ba835a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ba835a7

Please sign in to comment.