This repository has been archived by the owner on May 1, 2024. It is now read-only.
[Bug] [Shell] Navigation URL parameter not correctly encoded/decoded #10899
Labels
a/navigation
a/shell 🐚
in-progress
This issue has an associated pull request that may resolve it!
t/bug 🐛
Milestone
Description
Using Xamarin.Forms Shell navigation a URL is not correctly passed from one viewmodel to another viewmodel. Either the source viewmodel is not correctly encoding the URL, or the destination viewmodel is not correctly decoding it.
The :// part of the URL ends up with :/
For example, when you pass http://www.google.com to the destination viewmodel, the resulting URL becomes http:/www.google.com (with a single slash)
Steps to Reproduce
Using the following code in the source viewmodel:
In the destination viewmodel:
Here, _myUrl is http:/www.google.com.
I also tried to escape the URL before passing it, but that doesn't work:
await Shell.Current.GoToAsync($"general/showUrl?myUrl={Uri.EscapeUriString(url)}");
Expected Behavior
Source URL == Destination URL
Actual Behavior
2 slashes end up as 1 slash when passed.
Basic Information
Workaround
In destination ViewModel:
_myUrl = Uri.UnescapeDataString(value).Replace(":/", "://");
The text was updated successfully, but these errors were encountered: