-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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: injectQuery
break relative path
#9760
Conversation
test('normalize windows path', () => { | ||
expect(injectQuery('C:\\User\\Vite\\Project', 'direct')).toEqual( | ||
'C:/User/Vite/Project?direct' | ||
'C:\\User\\Vite\\Project?direct' | ||
) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can to exec normalizePath
it will reducing '..' and '.' parts. But now it will lose When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.
this feature.
Description
fix: #9525
Additional context
injectQuery break the relative path. if url[0] is not '/' should be relative path, should
.slice(1)
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).