mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
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:
parent
d83e543a98
commit
a9b252b8fa
@ -39,6 +39,15 @@ module.exports = {
|
||||
|
||||
var adminApp = express();
|
||||
|
||||
var defaultServerSettings = {
|
||||
"x-powered-by": false
|
||||
}
|
||||
var serverSettings = Object.assign({},defaultServerSettings,settings.httpServerOptions||{});
|
||||
for (var eOption in serverSettings) {
|
||||
adminApp.set(eOption, serverSettings[eOption]);
|
||||
}
|
||||
|
||||
|
||||
// Flows
|
||||
adminApp.get("/flows",needsPermission("flows.read"),flows.get,apiUtil.errorHandler);
|
||||
adminApp.post("/flows",needsPermission("flows.write"),flows.post,apiUtil.errorHandler);
|
||||
|
@ -64,10 +64,12 @@ module.exports = {
|
||||
}
|
||||
});
|
||||
}
|
||||
if (settings.httpServerOptions) {
|
||||
for (var eOption in settings.httpServerOptions) {
|
||||
editorApp.set(eOption, settings.httpServerOptions[eOption]);
|
||||
}
|
||||
var defaultServerSettings = {
|
||||
"x-powered-by": false
|
||||
}
|
||||
var serverSettings = Object.assign({},defaultServerSettings,settings.httpServerOptions||{});
|
||||
for (var eOption in serverSettings) {
|
||||
editorApp.set(eOption, serverSettings[eOption]);
|
||||
}
|
||||
editorApp.get("/",ensureRuntimeStarted,ui.ensureSlash,ui.editor);
|
||||
|
||||
|
@ -64,6 +64,14 @@ function init(settings,_server,storage,runtimeAPI) {
|
||||
}
|
||||
}
|
||||
|
||||
var defaultServerSettings = {
|
||||
"x-powered-by": false
|
||||
}
|
||||
var serverSettings = Object.assign({},defaultServerSettings,settings.httpServerOptions||{});
|
||||
for (var eOption in serverSettings) {
|
||||
adminApp.set(eOption, serverSettings[eOption]);
|
||||
}
|
||||
|
||||
auth.init(settings,storage);
|
||||
|
||||
var maxApiRequestSize = settings.apiMaxLength || '5mb';
|
||||
|
10
packages/node_modules/node-red/red.js
vendored
10
packages/node_modules/node-red/red.js
vendored
@ -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 = [];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user