get rid of path.resolve

This doesn't handle '..' and other things that
path.resolve does, but if you're passing weird
things to a URL, your fault.
This commit is contained in:
jomo 2015-04-25 15:49:47 +02:00
parent 22ea5a7e27
commit 79ab296f1f

View File

@ -44,9 +44,8 @@ function request_id() {
// splits a URL path into an Array
// the path is resolved and decoded
function path_list(pathname) {
// remove trailing and double slashes + other junk
pathname = path.resolve(pathname);
// remove double and trailing slashes
pathname = pathname.replace(/\/\/+/g, "/").replace(/\/$/, "");
var list = pathname.split("/");
list.shift();
for (var i = 0; i < list.length; i++) {