From 5196440e65bd168be625fa291776d20e2c84d497 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 6 Apr 2020 10:16:02 -0400 Subject: [PATCH] guard against a typeError when httpSafeOrigin is not defined --- server.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 2e6869b9f..8508eba83 100644 --- a/server.js +++ b/server.js @@ -43,7 +43,9 @@ if (process.env.PACKAGE) { } config.httpUnsafeOrigin = config.httpUnsafeOrigin.trim(); - config.httpSafeOrigin = config.httpSafeOrigin.trim().replace(/\/$/, ''); + if (typeof(config.httpSafeOrigin) === 'string') { + config.httpSafeOrigin = config.httpSafeOrigin.trim().replace(/\/$/, ''); + } // fall back to listening on a local address // if httpAddress is not a string