feat: updated dependencies

This commit is contained in:
SamTV12345 2025-06-25 13:04:41 +02:00
parent b0a796da60
commit f2a5564bc5

View file

@ -27,6 +27,12 @@ exports.expressCreateServer = (hookName: string, args: ArgsExpressType, cb: Func
const parsedUrl = url.parse(req.url); const parsedUrl = url.parse(req.url);
// extract URL path // extract URL path
let pathname = ADMIN_PATH + `${parsedUrl.pathname}`; let pathname = ADMIN_PATH + `${parsedUrl.pathname}`;
pathname = path.normalize(path.join(ADMIN_PATH), parsedUrl.pathname)
if (!pathname.startsWith(ADMIN_PATH)) {
res.statusCode = 403;
return res.end("Forbidden");
}
// based on the URL path, extract the file extension. e.g. .js, .doc, ... // based on the URL path, extract the file extension. e.g. .js, .doc, ...
let ext = path.parse(pathname).ext; let ext = path.parse(pathname).ext;
// maps file extension to MIME typere // maps file extension to MIME typere