[vs17.9] [ClickOnce] [GB18030] Workaround for incorrect encoding of chars in the PUA range of file paths#9669
Merged
JanKrivanek merged 4 commits intodotnet:vs17.9from Jan 26, 2024
Conversation
…PUA range of file paths
|
Hello! I noticed that you're targeting one of our servicing branches. Please consider updating the version. |
John-Hart
approved these changes
Jan 20, 2024
|
Hello! I noticed that you're targeting one of our servicing branches. Please consider updating the version. |
JanKrivanek
approved these changes
Jan 23, 2024
Member
JanKrivanek
left a comment
There was a problem hiding this comment.
Overall looks good - I have minor comments
JanKrivanek
approved these changes
Jan 24, 2024
Member
JanKrivanek
left a comment
There was a problem hiding this comment.
(already reviewed - but reviewing as explicitly requested kitten)
YuliiaKovalova
approved these changes
Jan 26, 2024
AR-May
approved these changes
Jan 26, 2024
…sbuild into user/sujitn/1939151
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #
AB#1939151
Summary
Uri class when passed a GB18030 string with chars in the PUA range incorrectly encodes the PUA chars.
For e.g. if the PUA char is u+e038, Uri encodes it in UTF-8 as %25EE%2580%25B8 instead of %EE%80%B8 by double encoding the %.
The ClickOnce scenario that is failing is when an app's Installation Uri is set to a UNC path that has PUA chars. In this case, the UNC path is written to the Clickonce manifest. When the app is being installed, ClickOnce Runtime will attempt to download the deployment manifest from the UNC path. Since the Uri is incorrectly encoded, this download will fail.
Changes Made
The FormatUrl function is being updated to resolve this issue. This function takes input path as string and return a canonicalized path by constructing a Uri class with the input path and then returning it's AbsoluteUri property.
In the case where the Uri's Scheme is File (file://), the function will now check if there are non-ascii characters in it and if so, create a new Uri with the UriBuilder class. The Uri created by UriBuilder correctly handles PUA range in GB18030.
Customer Impact
ClickOnce apps published with Installation path set to a UNC path containing GB18030 + PUA chars will be installed correctly after this change.
Testing
Failing scenario has been validated and CTI team has run regression tests on affected scenarios (scenarios where Uri are used for publishing).
Notes