You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is incorrect behavior, as the query string '+' is distinct from the query string '%2B'. For instance, if you have a script that, when run, prints a URL that url-encodes an email address like [email protected] in a query parameter, when clicked, the browser would send a query parameter that would decode on the server to test [email protected].
The correct fix would be to have the URI class represent query strings in their encoded form, only decoding them as needed. But this might cause problems with other users of the class that have relied on the assumption that the query string is decoded.
(Note that it would be incorrect to do the inverse; calling encodeURIComponent on the decoded query string would change all the ampersands delimiting query parameters into their encoded equivalents.)
This would likely fix #32026 but this problem is more general.
The text was updated successfully, but these errors were encountered:
This has nothing to with parse but with toString, esp. toString(skipEncoding: boolean) which is how we call it when opening uris for the browser (which will then do the http-specific encoding).
Steps to Reproduce:
Does this issue occur when all extensions are disabled?: Yes
Root cause seems to be that https://github.com/Microsoft/vscode/blob/6fae52876b1f9e549a6e1b91789d5fff82d61f0c/src/vs/base/common/uri.ts#L228 calls
decodeURIComponent
on the query string.This is incorrect behavior, as the query string '+' is distinct from the query string '%2B'. For instance, if you have a script that, when run, prints a URL that url-encodes an email address like
[email protected]
in a query parameter, when clicked, the browser would send a query parameter that would decode on the server totest [email protected]
.The correct fix would be to have the URI class represent query strings in their encoded form, only decoding them as needed. But this might cause problems with other users of the class that have relied on the assumption that the query string is decoded.
(Note that it would be incorrect to do the inverse; calling encodeURIComponent on the decoded query string would change all the ampersands delimiting query parameters into their encoded equivalents.)
This would likely fix #32026 but this problem is more general.
The text was updated successfully, but these errors were encountered: