mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 23:25:45 +03:00
Additional uri parsing intelligence (#861)
This commit is contained in:
parent
69e0906491
commit
9d27f111bf
2 changed files with 12 additions and 4 deletions
|
@ -164,9 +164,13 @@ namespace Bit.Droid.Accessibility
|
|||
{
|
||||
return uri;
|
||||
}
|
||||
if (Uri.TryCreate("http://" + uri, UriKind.Absolute, out var uri3))
|
||||
var hasHttpProtocol = uri.StartsWith("http://") || uri.StartsWith("https://");
|
||||
if (!hasHttpProtocol && uri.Contains("."))
|
||||
{
|
||||
return string.Concat("http://", uri);
|
||||
if (Uri.TryCreate("http://" + uri, UriKind.Absolute, out var uri3))
|
||||
{
|
||||
return string.Concat("http://", uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
return uri;
|
||||
|
|
|
@ -89,9 +89,13 @@ namespace Bit.Core.Utilities
|
|||
{
|
||||
return uri;
|
||||
}
|
||||
if (Uri.TryCreate("http://" + uriString, UriKind.Absolute, out var uri2))
|
||||
var hasHttpProtocol = uriString.StartsWith("http://") || uriString.StartsWith("https://");
|
||||
if (!hasHttpProtocol && uriString.Contains("."))
|
||||
{
|
||||
return uri2;
|
||||
if (Uri.TryCreate("http://" + uriString, UriKind.Absolute, out var uri2))
|
||||
{
|
||||
return uri2;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue