Attempt URI healing with https prior to http (#1186)

* Attempt URI healing with https prior to http

Browsers are moving away from displaying URI scheme in a way
accessibility can easily grab. This causes this URI healing to be relied
upon more frequently. It should attempt https prior to http due to
prevelence of https and security concerns with passwords over http.

* Just use https as the URI healing scheme
This commit is contained in:
Matt Gibson 2020-12-21 09:58:26 -06:00 committed by GitHub
parent 217514af66
commit 0801dea6e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -390,12 +390,12 @@ namespace Bit.Droid.Accessibility
var hasHttpProtocol = uri.StartsWith("http://") || uri.StartsWith("https://");
if (!hasHttpProtocol && uri.Contains("."))
{
if (Uri.TryCreate("http://" + uri, UriKind.Absolute, out var uri2))
if (Uri.TryCreate("https://" + uri, UriKind.Absolute, out var _))
{
return string.Concat("http://", uri);
return string.Concat("https://", uri);
}
}
if (Uri.TryCreate(uri, UriKind.Absolute, out var uri3))
if (Uri.TryCreate(uri, UriKind.Absolute, out var _))
{
return uri;
}