mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
Don't let filenames be changed to Windows' backslash-notation.
This commit is contained in:
parent
45ba5d60dc
commit
45b7cafca4
1 changed files with 1 additions and 0 deletions
|
@ -57,6 +57,7 @@ exports.minify = function(req, res, next)
|
||||||
filename = path.normalize(path.join(ROOT_DIR, filename));
|
filename = path.normalize(path.join(ROOT_DIR, filename));
|
||||||
if (filename.indexOf(ROOT_DIR) == 0) {
|
if (filename.indexOf(ROOT_DIR) == 0) {
|
||||||
filename = filename.slice(ROOT_DIR.length);
|
filename = filename.slice(ROOT_DIR.length);
|
||||||
|
filename = filename.replace(/\\/g, '/'); // Windows (safe generally?)
|
||||||
} else {
|
} else {
|
||||||
res.writeHead(404, {});
|
res.writeHead(404, {});
|
||||||
res.end();
|
res.end();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue