guard against a typeError when httpSafeOrigin is not defined

This commit is contained in:
ansuz 2020-04-06 10:16:02 -04:00
parent 2b3f6e3464
commit 5196440e65
1 changed files with 3 additions and 1 deletions

View File

@ -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