fix public folder sharing for domains without dns

Signed-off-by: si458 <simonsmith5521@gmail.com>

si458 committed Oct 1, 2024 at 12:10 UTC 37729269ba3cb3d1ffec582c97587fb288a7344b
1 file changed +1
webserver.js
+1
@@ -3757,6 +3757,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
3757
3758 if (obj.common.validateString(req.path, 1, 4096) == false) { res.sendStatus(404); return; }
3759 var domainname = 'domain', spliturl = decodeURIComponent(req.path).split('/'), filename = '';
3760 + if (spliturl[1] != 'userfiles') { spliturl.splice(1,1); } // remove domain.id from url for domains without dns
3761 if ((spliturl.length < 3) || (obj.common.IsFilenameValid(spliturl[2]) == false) || (domain.userQuota == -1)) { res.sendStatus(404); return; }
3762 if (domain.id != '') { domainname = 'domain-' + domain.id; }
3763 var path = obj.path.join(obj.filespath, domainname + '/user-' + spliturl[2] + '/Public');