From 51832d3506b23b1a1335c1c2b907afd1ccada755 Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Fri, 28 Apr 2017 09:56:07 +0800 Subject: [PATCH] fix(util): fix crash, fixed #154 --- src/core/route/util.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/route/util.js b/src/core/route/util.js index e8cac63..38275f8 100644 --- a/src/core/route/util.js +++ b/src/core/route/util.js @@ -54,5 +54,7 @@ export const getParentPath = cached(path => { }) export const cleanPath = cached(path => { - return path.replace(/([^:])\/{2,}/g, '$1/') + return path + .replace(/^\/+/, '/') + .replace(/([^:])\/{2,}/g, '$1/') })