Skip to content

Commit

Permalink
fix: don't apply optional trailing slashes on paths === /
Browse files Browse the repository at this point in the history
  • Loading branch information
troch committed Aug 19, 2015
1 parent 45fe3bc commit 36e0180
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/Path.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ let tokenise = (str, tokens = []) => {
}

let optTrailingSlash = (source, trailingSlash) => {
if (!trailingSlash) return source
if (!trailingSlash || source === '/') return source
return source.replace(/\/$/, '') + '(?:\/)?'
}

Expand Down

0 comments on commit 36e0180

Please sign in to comment.