Remove reference to InvalidOperationException in Uri.OriginalString#2657
Merged
Thraka merged 1 commit intodotnet:masterfrom Jul 26, 2019
Merged
Remove reference to InvalidOperationException in Uri.OriginalString#2657Thraka merged 1 commit intodotnet:masterfrom
Thraka merged 1 commit intodotnet:masterfrom
Conversation
Uri.OriginalString does not throw InvalidOperationException if a relative URI is used. This is true for .NET Core 3.0+ (at least) and the .NET Framework 4.8 (via ReferenceSource). Sources: https://github.com/dotnet/corefx/blob/e2b4dc93c9f9482b67f962106937d4fdd46f5673/src/System.Private.Uri/src/System/Uri.cs#L1145-L1153 https://referencesource.microsoft.com/#System/net/System/URI.cs,1234
Member
|
Thanks for making this update @watfordgnf @karelz Can you verify this for accuracy? It looks good to me, but I want someone on the product team to verify. |
Thraka
approved these changes
Jul 26, 2019
Contributor
Thraka
left a comment
There was a problem hiding this comment.
I created an app to test on core 3.0 and framework 4.5 and there is no exception thrown. I also checked the source on the internal index and in github for core 2.2 and 3.0. No exception is thrown. I think this PR is OK to accept.
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.
Summary
Uri.OriginalString does not throw InvalidOperationException if a relative URI is used. This is true for .NET Core 3.0+ (at least) and the .NET Framework 4.8 (via ReferenceSource).
Sources: https://github.com/dotnet/corefx/blob/e2b4dc93c9f9482b67f962106937d4fdd46f5673/src/System.Private.Uri/src/System/Uri.cs#L1145-L1153
https://referencesource.microsoft.com/#System/net/System/URI.cs,1234
This caused some confusion developing Uri support in System.Text.Json dotnet/corefx#39015