mirror of
https://github.com/mathuo/dockview
synced 2025-02-08 17:35:44 +00:00
Block malicious looking requests to prevent path traversal attacks.
This commit is contained in:
parent
1a9ee8c34e
commit
fe39c475a2
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user