Skip to content

Fix: Encode paths as URI components when opening a folder or workspace#182398

Merged
bpasero merged 2 commits intomicrosoft:mainfrom
dyedgreen:uri-encode-folder-paths
May 15, 2023
Merged

Fix: Encode paths as URI components when opening a folder or workspace#182398
bpasero merged 2 commits intomicrosoft:mainfrom
dyedgreen:uri-encode-folder-paths

Conversation

@dyedgreen
Copy link
Contributor

Closes #182397

Encode folder paths as URI components, so that special characters like + are intepreted correctly. This change carves out a special case for / characters, which would be encoded as %2F to retain more pretty URIs.

This should prevent issues when trying to open folder paths that contain
special characters like `+` or `&`.
@dyedgreen
Copy link
Contributor Author

I'm not fully sure how to best add an automated test for this change, can you point me to some existing tests I could extend / use as a starting point?

@dyedgreen dyedgreen changed the title Encode paths as URI components when opening a folder or workspace Fix: Encode paths as URI components when opening a folder or workspace May 13, 2023
@bpasero bpasero self-requested a review May 15, 2023 07:37
Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

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

Thanks, pushed a 💄 We have no tests in that area.

@bpasero bpasero added this to the May 2023 milestone May 15, 2023
@bpasero bpasero marked this pull request as ready for review May 15, 2023 07:38
@bpasero bpasero enabled auto-merge (squash) May 15, 2023 07:38
@bpasero bpasero merged commit 29bf616 into microsoft:main May 15, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jun 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When opening a folder using VSCode server, paths containing special characters are misinterpreted

4 participants