Closed NinoFloris closed 1 month ago
Triage: Having consistency between platforms makes sense.
https://github.com/dotnet/runtime/issues/33029#event-14651253699
I suggest that this be reopened, @NinoFloris and @karelz. Irrespective, it's certainly not completed.
Related to https://github.com/dotnet/runtime/issues/22103
Uri
seems to be missing a capability to operate in a platform independent manner. We ran into this during testing. Today there seems to be no way to round-tripUri
across windows and unix machines. This must be an oversight.Concretely, transforming backslashes to forward slashes significantly changes meaning of the URI and could be dangerous. Especially when not done universally (as it happens here, depending on runtime platform) as I would expect very few to actually run tests on all platforms.
This speaks to a broader problem for .NET when it moved xplat, as seen in Sockets, Path, Uri, and other concepts that Unix/Windows have in common.
Platform dependent implementations of universal concepts are fine as long as they either:
As an example
Path
would be exempted because it's inherently tied to platform capabilities. Uri however is universal, though it provides neither escape hatches nor uniform semantics. I would argue Uri is a prime example of an api that must allow for lossless round-tripping.