Ensure httpServerOptions gets applied to ALL the express apps

This is silly. Turns out setting options at a top level app
does not percolate down to sub apps (and vice versa). You
have to apply the options to ALL express apps.
This commit is contained in:
Nick O'Leary
2021-06-08 21:17:42 +01:00
parent d83e543a98
commit a9b252b8fa
4 changed files with 33 additions and 4 deletions

View File

@@ -194,6 +194,16 @@ if (process.env.NODE_RED_ENABLE_PROJECTS) {
settings.editorTheme.projects.enabled = !/^false$/i.test(process.env.NODE_RED_ENABLE_PROJECTS);
}
var defaultServerSettings = {
"x-powered-by": false
}
var serverSettings = Object.assign({},defaultServerSettings,settings.httpServerOptions||{});
for (var eOption in serverSettings) {
app.set(eOption, serverSettings[eOption]);
}
// Delay logging of (translated) messages until the RED object has been initialized
var delayedLogItems = [];