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: clean more than two consecutive slashes #3652

Merged
merged 1 commit into from Oct 26, 2021

Conversation

danielroe
Copy link
Member

Issue:
Currently a path beginning with three slashes (///) will in fact potentially redirect to another domain. This is because the cleanPath utility only replaces two slashes, leaving two behind.

Reproduction:
https://stackblitz.com/edit/vue-router-3-redirect

This PR simply replaces consecutive slashes with a single slash.

Copy link
Member

@posva posva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically this is not the correct fix as cleanPath is used in a variety of places, so it would change routes that have multiple slashes but at the same time, it's already turning paths like //thing into /thing so this simple fix shouldn't have any undesired side effects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

replaceState Error when path starts with // and scrollBehavior is set
2 participants