Fixed meshcore downloads.

Ylian Saint-Hilaire committed Jan 26, 2021 at 12:40 UTC 104f33373425ff3d1b6fb5ccbb6539a94e6904c1
2 files changed +3 -3
translate/translate.json
+1 -1
@@ -46393,4 +46393,4 @@
46393 ]
46394 }
46395 ]
46396 -}
46396 +}
\ No newline at end of file
webserver.js
+2 -2
@@ -4526,9 +4526,9 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
4526 if (req.query.dlcore != null) {
4527 // Download mesh core
4528 var bin = parent.defaultMeshCores[req.query.dlcore];
4529 - if (bin == null) { try { res.sendStatus(404); } catch (ex) { } return; }
4529 + if ((bin == null) || (bin.length < 5)) { try { res.sendStatus(404); } catch (ex) { } return; }
4530 setContentDispositionHeader(res, 'application/octet-stream', req.query.dlcore + '.js', null, 'meshcore.js');
4531 - res.send(bin);
4531 + res.send(bin.substring(4));
4532 return;
4533 }
4534