Additional URI parsing fix (#865)
* Additional URI parsing fix * name cleanup
This commit is contained in:
parent
99dceda8ac
commit
36cdc7dd1c
|
@ -161,18 +161,18 @@ namespace Bit.Droid.Accessibility
|
|||
uri = browser.GetUriFunction(addressNode.Text)?.Trim();
|
||||
if (uri != null && uri.Contains("."))
|
||||
{
|
||||
if (Uri.TryCreate(uri, UriKind.Absolute, out var uri2))
|
||||
{
|
||||
return uri;
|
||||
}
|
||||
var hasHttpProtocol = uri.StartsWith("http://") || uri.StartsWith("https://");
|
||||
if (!hasHttpProtocol && uri.Contains("."))
|
||||
{
|
||||
if (Uri.TryCreate("http://" + uri, UriKind.Absolute, out var uri3))
|
||||
if (Uri.TryCreate("http://" + uri, UriKind.Absolute, out var uri2))
|
||||
{
|
||||
return string.Concat("http://", uri);
|
||||
}
|
||||
}
|
||||
if (Uri.TryCreate(uri, UriKind.Absolute, out var uri3))
|
||||
{
|
||||
return uri;
|
||||
}
|
||||
}
|
||||
return uri;
|
||||
}
|
||||
|
|
|
@ -85,18 +85,18 @@ namespace Bit.Core.Utilities
|
|||
{
|
||||
return null;
|
||||
}
|
||||
if (Uri.TryCreate(uriString, UriKind.Absolute, out var uri))
|
||||
{
|
||||
return uri;
|
||||
}
|
||||
var hasHttpProtocol = uriString.StartsWith("http://") || uriString.StartsWith("https://");
|
||||
if (!hasHttpProtocol && uriString.Contains("."))
|
||||
{
|
||||
if (Uri.TryCreate("http://" + uriString, UriKind.Absolute, out var uri2))
|
||||
if (Uri.TryCreate("http://" + uriString, UriKind.Absolute, out var uri))
|
||||
{
|
||||
return uri2;
|
||||
return uri;
|
||||
}
|
||||
}
|
||||
if (Uri.TryCreate(uriString, UriKind.Absolute, out var uri2))
|
||||
{
|
||||
return uri2;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue