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
Merged

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Oct 25, 2021

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.

posva
posva approved these changes Oct 26, 2021
Copy link
Member

@posva posva left a comment

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.

@posva posva linked an issue that may be closed by this pull request Oct 26, 2021
@posva posva merged commit 3e3a07e into vuejs:dev Oct 26, 2021
10 checks passed
@danielroe danielroe deleted the fix/triple-slash branch Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants