-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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] TryCreate doubles file:/// Uris with certain escaped unreserved characters #36288
Labels
Milestone
Comments
Dotnet-GitSync-Bot
added
area-System.Net
untriaged
New issue has not been triaged by the area owner
labels
May 12, 2020
Tagging subscribers to this area: @dotnet/ncl |
ScottLouvau
pushed a commit
to microsoft/sarif-sdk
that referenced
this issue
May 12, 2020
- Now serializing OriginalString as-is to ensure no doubling can occur. - This means we won't try to sanitize or canonicalize user-provided Uris anymore. - Consolidated test data into one of the two test classes. - Changed verification to check that the Uri reloads equal to the user-created original, not that the written SARIF has a canonicalized value. - Update an invalid Uri test expected file which expected somewhat-sanitized Uris. See dotnet/runtime#36288 for a .NET Framework bug I've reported on this issue.
karelz
changed the title
Uri.TryCreate doubles file:/// Uris with certain escaped unreserved characters
[Uri] TryCreate doubles file:/// Uris with certain escaped unreserved characters
May 12, 2020
Duplicate of #1061 |
ScottLouvau
pushed a commit
to microsoft/sarif-sdk
that referenced
this issue
May 13, 2020
…rs. (#1871) * UriConverter fix to avoid doubling Uris with certain escaped characters. - Now serializing OriginalString as-is to ensure no doubling can occur. - This means we won't try to sanitize or canonicalize user-provided Uris anymore. - Consolidated test data into one of the two test classes. - Changed verification to check that the Uri reloads equal to the user-created original, not that the written SARIF has a canonicalized value. - Update an invalid Uri test expected file which expected somewhat-sanitized Uris. See dotnet/runtime#36288 for a .NET Framework bug I've reported on this issue. * PR feedback, update version and release notes.
ghost
locked as resolved and limited conversation to collaborators
Dec 9, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It looks like Uri.TryCreate() handles certain escaped characters incorrectly, doubling the Uri.
For example:
Output: file:///new%2Dhost/share/folder/file.cs/new-host/share/folder/file.cs
This reproduces for
file:///
Uris with dash (%2D
) and underscore (%5F
), either in the first part of the Uri or later in the path. It does not reproduce for space (%20
) or parens (%28
,%29
). I didn't try every escaping.The text was updated successfully, but these errors were encountered: