-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Uri doesn't honour http-specialities #31805
Comments
I don't think this is markdown specific. I see the same behavior when clicking on that link in the editor. Root cause seems to be our Uri parsing logic: URI.parse('https://azure.microsoft.com/en-us/?ru=https%3A%2F%2Fmicrosoft.com%2F%3Fparam1%3Dvalue1%26param2%3Dvalue2') returns
Whereas decodeURI('https://azure.microsoft.com/en-us/?ru=https%3A%2F%2Fmicrosoft.com%2F%3Fparam1%3Dvalue1%26param2%3Dvalue2') returns
|
The parsing logic doesn't return a string as that comment suggests but simply parses an input string into URI components (scheme, auth, path, query, fragment). The Assuming that the result of |
dupe of #25852 |
Steps to Reproduce:
Create and MD file and paste the following link:
https://azure.microsoft.com/en-us/?ru=https%3A%2F%2Fmicrosoft.com%2F%3Fparam1%3Dvalue1%26param2%3Dvalue2
Preview and click on the link. You will be sent to https://azure.microsoft.com/en-us/?ru=https://microsoft.com/%3Fparam1=value1¶m2=value2
Notice that the url parameter
ru
is an encoded link. VSCode decodes the parameter and the final link becomes incorrect. Just compare to how GitHub works when you click on the link in step 1.Reproduces without extensions: Yes
The text was updated successfully, but these errors were encountered: