don't remove trailing slash for root path

This commit is contained in:
jomo 2015-04-25 15:55:59 +02:00
parent 79ab296f1f
commit efd9c0ccee

View File

@ -45,7 +45,7 @@ function request_id() {
// the path is resolved and decoded // the path is resolved and decoded
function path_list(pathname) { function path_list(pathname) {
// remove double and trailing slashes // remove double and trailing slashes
pathname = pathname.replace(/\/\/+/g, "/").replace(/\/$/, ""); pathname = pathname.replace(/\/\/+/g, "/").replace(/(.)\/$/, "$1");
var list = pathname.split("/"); var list = pathname.split("/");
list.shift(); list.shift();
for (var i = 0; i < list.length; i++) { for (var i = 0; i < list.length; i++) {