mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
Remove unnecessary path.normalize()
calls
`path.join()` already normalizes.
This commit is contained in:
parent
84c1d74f8b
commit
f868788417
6 changed files with 9 additions and 10 deletions
|
@ -29,8 +29,7 @@ exports.expressCreateServer = (hookName, args, cb) => {
|
|||
res.end(`var specs_list = ${JSON.stringify(files)};\n`);
|
||||
});
|
||||
|
||||
// path.join seems to normalize by default, but we'll just be explicit
|
||||
const rootTestFolder = path.normalize(path.join(npm.root, '../tests/frontend/'));
|
||||
const rootTestFolder = path.join(npm.root, '../tests/frontend/');
|
||||
|
||||
const url2FilePath = (url) => {
|
||||
let subPath = url.substr('/tests/frontend'.length);
|
||||
|
@ -39,7 +38,7 @@ exports.expressCreateServer = (hookName, args, cb) => {
|
|||
}
|
||||
subPath = subPath.split('?')[0];
|
||||
|
||||
let filePath = path.normalize(path.join(rootTestFolder, subPath));
|
||||
let filePath = path.join(rootTestFolder, subPath);
|
||||
|
||||
// make sure we jail the paths to the test folder, otherwise serve index
|
||||
if (filePath.indexOf(rootTestFolder) !== 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue