mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-10-29 15:25:01 -04:00
disable compression by default and dont compress webrelays #4369
Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
parent
e47626a688
commit
92c2b61318
@ -536,8 +536,8 @@
|
|||||||
},
|
},
|
||||||
"compression": {
|
"compression": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true,
|
"default": false,
|
||||||
"description": "Enables GZIP compression for web requests."
|
"description": "Enables GZIP compression for web requests. Disabled by default."
|
||||||
},
|
},
|
||||||
"wsCompression": {
|
"wsCompression": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
|
|||||||
@ -14,7 +14,6 @@ module.exports.CreateMonitoring = function (parent, args) {
|
|||||||
obj.express = require('express');
|
obj.express = require('express');
|
||||||
obj.app = obj.express();
|
obj.app = obj.express();
|
||||||
obj.prometheus = null;
|
obj.prometheus = null;
|
||||||
if (args.compression !== false) { obj.app.use(require('compression')()); }
|
|
||||||
obj.app.disable('x-powered-by');
|
obj.app.disable('x-powered-by');
|
||||||
obj.counterMetrics = { // Counter Metrics always start at 0 and increase but never decrease
|
obj.counterMetrics = { // Counter Metrics always start at 0 and increase but never decrease
|
||||||
RelayErrors: { description: "Relay Errors" }, // parent.webserver.relaySessionErrorCount
|
RelayErrors: { description: "Relay Errors" }, // parent.webserver.relaySessionErrorCount
|
||||||
|
|||||||
@ -65,7 +65,7 @@
|
|||||||
"_agentIdleTimeout": 150,
|
"_agentIdleTimeout": 150,
|
||||||
"_webPageLengthRandomization": false,
|
"_webPageLengthRandomization": false,
|
||||||
"_compression": true,
|
"_compression": true,
|
||||||
"_wsCompression": false,
|
"_wsCompression": true,
|
||||||
"_agentWsCompression": true,
|
"_agentWsCompression": true,
|
||||||
"_noAgentUpdate": 1,
|
"_noAgentUpdate": 1,
|
||||||
"_agentUpdateSystem": 1,
|
"_agentUpdateSystem": 1,
|
||||||
|
|||||||
@ -23,7 +23,6 @@ module.exports.CreateWebRelayServer = function (parent, db, args, certificates,
|
|||||||
obj.tlsServer = null;
|
obj.tlsServer = null;
|
||||||
obj.net = require('net');
|
obj.net = require('net');
|
||||||
obj.app = obj.express();
|
obj.app = obj.express();
|
||||||
if (args.compression !== false) { obj.app.use(require('compression')()); }
|
|
||||||
obj.app.disable('x-powered-by');
|
obj.app.disable('x-powered-by');
|
||||||
obj.webRelayServer = null;
|
obj.webRelayServer = null;
|
||||||
obj.port = 0;
|
obj.port = 0;
|
||||||
|
|||||||
@ -65,9 +65,10 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
|
|||||||
obj.db = db;
|
obj.db = db;
|
||||||
obj.app = obj.express();
|
obj.app = obj.express();
|
||||||
if (obj.args.agentport) { obj.agentapp = obj.express(); }
|
if (obj.args.agentport) { obj.agentapp = obj.express(); }
|
||||||
if (args.compression !== false) {
|
if (args.compression === true) {
|
||||||
obj.app.use(require('compression')({ filter: function (req, res) {
|
obj.app.use(require('compression')({ filter: function (req, res) {
|
||||||
if (req.path == '/devicefile.ashx') return false; // Don't compress device file transfers to show file sizes
|
if (req.path == '/devicefile.ashx') return false; // Don't compress device file transfers to show file sizes
|
||||||
|
if ((args.relaydns != null) && (obj.args.relaydns.indexOf(req.hostname) >= 0)) return false; // Don't compress DNS relay requests
|
||||||
return require('compression').filter(req, res);
|
return require('compression').filter(req, res);
|
||||||
}}));
|
}}));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user