Server fix.
Ylian Saint-Hilaire committed
Jun 21, 2020 at 14:31 UTC
3cca8a5954cb32751fb3d9f0ecffc7dcb60cd829
1 file changed
+2
-1
webserver.js
+2
-1
@@ -2975,7 +2975,8 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
2975
if ((user == null) || (user.siteadmin & 8) == 0) { res.sendStatus(401); return; } // Check if we have file rights
2976
2977
if ((fields == null) || (fields.link == null) || (fields.link.length != 1)) { /*console.log('UploadFile, Invalid Fields:', fields, files);*/ console.log('err4'); res.sendStatus(404); return; }
2978
- var xfile = obj.getServerFilePath(user, domain, decodeURIComponent(fields.link[0]));
2978
+ var xfile = null;
2979
+ try { xfile = obj.getServerFilePath(user, domain, decodeURIComponent(fields.link[0])); } catch (ex) { }
2980
if (xfile == null) { res.sendStatus(404); return; }
2981
// Get total bytes in the path
2982
var totalsize = readTotalFileSize(xfile.fullpath);