Skip to content

Commit

Permalink
fix(util): fix crash, fixed #154
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li committed Apr 28, 2017
1 parent 25ccc79 commit 51832d3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/route/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/')
})

0 comments on commit 51832d3

Please sign in to comment.