Browse Source

don't remove trailing slash for root path

jomo 10 years ago
parent
commit
efd9c0ccee
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/server.js

+ 1 - 1
lib/server.js

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