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,11 +164,15 @@ namespace Bit.Droid.Accessibility
|
|||
{
|
||||
return uri;
|
||||
}
|
||||
var hasHttpProtocol = uri.StartsWith("http://") || uri.StartsWith("https://");
|
||||
if (!hasHttpProtocol && uri.Contains("."))
|
||||
{
|
||||
if (Uri.TryCreate("http://" + uri, UriKind.Absolute, out var uri3))
|
||||
{
|
||||
return string.Concat("http://", uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
return uri;
|
||||
}
|
||||
|
||||
|
|
|
@ -89,10 +89,14 @@ namespace Bit.Core.Utilities
|
|||
{
|
||||
return uri;
|
||||
}
|
||||
var hasHttpProtocol = uriString.StartsWith("http://") || uriString.StartsWith("https://");
|
||||
if (!hasHttpProtocol && uriString.Contains("."))
|
||||
{
|
||||
if (Uri.TryCreate("http://" + uriString, UriKind.Absolute, out var uri2))
|
||||
{
|
||||
return uri2;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue