diff options
author | Tom Hunkapiller <tom@furycodes.com> | 2015-04-10 20:19:26 -0500 |
---|---|---|
committer | Tom Hunkapiller <tom@furycodes.com> | 2015-04-10 20:19:26 -0500 |
commit | 2e4374c08ddbc0753a486f23b45df65f0cbd7eb5 (patch) | |
tree | 907397815af1be88900ffa93572636f7449d8b32 /src/node/hooks | |
parent | 3ebb19d8a2964abe4c21700a4208b1a66f39eb85 (diff) | |
download | etherpad-lite-2e4374c08ddbc0753a486f23b45df65f0cbd7eb5.zip |
clearer comments about the path handling behavior
Diffstat (limited to 'src/node/hooks')
-rw-r--r-- | src/node/hooks/express/tests.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/node/hooks/express/tests.js b/src/node/hooks/express/tests.js index f3d721a9..d0dcc0cc 100644 --- a/src/node/hooks/express/tests.js +++ b/src/node/hooks/express/tests.js @@ -23,7 +23,10 @@ exports.expressCreateServer = function (hook_name, args, cb) { }); - var rootTestFolder = path.join(npm.root, "..", "/tests/frontend/"); + + // path.join seems to normalize by default, but we'll just be explicit + var rootTestFolder = path.normalize(path.join(npm.root, "../tests/frontend/")); + var url2FilePath = function(url){ var subPath = url.substr("/tests/frontend".length); if (subPath == ""){ @@ -34,7 +37,7 @@ exports.expressCreateServer = function (hook_name, args, cb) { var filePath = path.normalize(path.join(rootTestFolder, subPath)); // make sure we jail the paths to the test folder, otherwise serve index if (filePath.indexOf(rootTestFolder) !== 0) { - filePath = path.normalize(path.join(rootTestFolder, "index.html")); + filePath = path.join(rootTestFolder, "index.html"); } return filePath; } |