Skip to content

Commit

Permalink
fix(html5): make base case insensitive
Browse files Browse the repository at this point in the history
Fix #2154

This is mostly convenience so it's always made case insensitive. If there are
any case sensitive requirements, the test should be made server side.
  • Loading branch information
posva committed May 9, 2020
1 parent 11e779a commit 04a2143
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/history/html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class HTML5History extends History {

export function getLocation (base: string): string {
let path = decodeURI(window.location.pathname)
if (base && path.indexOf(base) === 0) {
if (base && path.toLowerCase().indexOf(base.toLowerCase()) === 0) {
path = path.slice(base.length)
}
return (path || '/') + window.location.search + window.location.hash
Expand Down

0 comments on commit 04a2143

Please sign in to comment.