Fixed server crash on file download.

This commit is contained in:
Ylian Saint-Hilaire 2020-10-27 14:11:10 -07:00
parent 99d00829d9
commit a318062c7e
2 changed files with 2 additions and 2 deletions

View File

@ -203,7 +203,7 @@ module.exports.CreateMeshDeviceFile = function (parent, ws, res, req, domain, us
try { cmd = JSON.parse(data); } catch (ex) { }
if ((cmd == null) || (typeof cmd.op == 'string')) {
if (cmd.op == 'ok') {
setContentDispositionHeader(this.res, 'application/octet-stream', filename, cmd.size, 'file.bin');
setContentDispositionHeader(this.res, 'application/octet-stream', this.file, cmd.size, 'file.bin');
} else {
try { this.res.sendStatus(401); } catch (ex) { }
}

View File

@ -1,6 +1,6 @@
{
"name": "meshcentral",
"version": "0.6.67",
"version": "0.6.68",
"keywords": [
"Remote Device Management",
"Remote Device Monitoring",