Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(vue-app): sanitize path with trailing slash in getLocation (#6744) #6745

Merged
merged 11 commits into from Jun 30, 2020
3 changes: 2 additions & 1 deletion packages/vue-app/template/utils.js
Expand Up @@ -264,7 +264,8 @@ export function getLocation (base, mode) {
if (mode === 'hash') {
return window.location.hash.replace(/^#\//, '')
}
if (base && path.indexOf(base) === 0) {
// To get matched with sanitized router.base add trailing slash
if (base && (path.endsWith('/') ? path : path + '/').startsWith(base)) {
pi0 marked this conversation as resolved.
Show resolved Hide resolved
path = path.slice(base.length)
}
return (path || '/') + window.location.search + window.location.hash
Expand Down