Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
Fix for authority to make sure we get the port. (#452)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmontemagno authored and Redth committed Aug 14, 2018
1 parent 555a589 commit e6f925e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Tests/Browser_Tests.cs
Expand Up @@ -25,6 +25,8 @@ public class BrowserTests

[Theory]
[InlineData("https://xamarin.com", "https://xamarin.com")]
[InlineData("https://xamarin.com/test.html", "https://xamarin.com/test.html")]
[InlineData("https://xamarin.com:56/test.html", "https://xamarin.com:56/test.html")]
[InlineData("http://xamarin.com", "http://xamarin.com")]
[InlineData("https://xamariñ.com", "https://xn--xamari-1wa.com")]
[InlineData("http://xamariñ.com", "http://xn--xamari-1wa.com")]
Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Essentials/Browser/Browser.shared.cs
Expand Up @@ -30,7 +30,7 @@ internal static Uri EscapeUri(Uri uri)
return uri;
#else
var idn = new System.Globalization.IdnMapping();
return new Uri(uri.Scheme + "://" + idn.GetAscii(uri.DnsSafeHost) + uri.PathAndQuery);
return new Uri(uri.Scheme + "://" + idn.GetAscii(uri.Authority) + uri.PathAndQuery);
#endif
}
}
Expand Down

0 comments on commit e6f925e

Please sign in to comment.