Merge pull request #759 from JafarAkhondali/master

Fixing a Path Traversal Vulnerability
This commit is contained in:
mathuo 2024-11-10 10:42:03 +00:00 committed by GitHub
commit 93b29e77c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -35,5 +35,10 @@ function write(res, file) {
http.createServer((req, res) => {
const route = req.url.split('/').slice(1);
if (route.includes('..')) {
res.writeHead(403);
res.end('');
return;
}
write(res, route);
}).listen(PORT, HOST);