Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Use Uri.OriginalString when serializing#39015

Merged
JeremyKuhne merged 2 commits intodotnet:masterfrom
JeremyKuhne:originaluri
Jul 8, 2019
Merged

Use Uri.OriginalString when serializing#39015
JeremyKuhne merged 2 commits intodotnet:masterfrom
JeremyKuhne:originaluri

Conversation

@JeremyKuhne
Copy link
Copy Markdown
Member

We want to be lossless if possible when round tripping (outside of escaping). To do so we need to write OriginalString instead of using ToString().

Removing pending issue reference as it was closed (we won't be adding a Uri parser to the reader).

Add user reported scenario. #38568

@JeremyKuhne JeremyKuhne added this to the 3.0 milestone Jun 27, 2019
@JeremyKuhne JeremyKuhne self-assigned this Jun 27, 2019
@watfordgnf
Copy link
Copy Markdown
Contributor

watfordgnf commented Jun 28, 2019

I made the comment on the original work by @layomia that Uri.OriginalString would throw for relative URI's. This was based on the current documentation, which is apparently out of date. I've submitted dotnet/dotnet-api-docs#2657 to update the documentation around Uri.OriginalString to match the actual behavior of .NET Core and .NET Framework.

I believe perhaps AbsoluteUri's documentation was copied as the start for OriginalString, which included the exception.

We want to be lossless if possible when round tripping (outside of escaping). To do so we need to write OriginalString instead of using ToString().

Removing pending issue reference as it was closed (we won't be adding a Uri parser to the reader).

Add user reported scenario.
@JeremyKuhne JeremyKuhne merged commit 398dc98 into dotnet:master Jul 8, 2019
@JeremyKuhne JeremyKuhne deleted the originaluri branch July 8, 2019 21:07
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* Use Uri.OriginalString when serializing

We want to be lossless if possible when round tripping (outside of escaping). To do so we need to write OriginalString instead of using ToString().

Removing pending issue reference as it was closed (we won't be adding a Uri parser to the reader).

Add user reported scenario.

* Address feedback


Commit migrated from dotnet/corefx@398dc98
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants