mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-07-03 03:12:15 -04:00
feat: updated dependencies
This commit is contained in:
parent
b0a796da60
commit
f2a5564bc5
1 changed files with 6 additions and 0 deletions
|
@ -27,6 +27,12 @@ exports.expressCreateServer = (hookName: string, args: ArgsExpressType, cb: Func
|
|||
const parsedUrl = url.parse(req.url);
|
||||
// extract URL path
|
||||
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, ...
|
||||
let ext = path.parse(pathname).ext;
|
||||
// maps file extension to MIME typere
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue