mirror of
https://github.com/bitwarden/server.git
synced 2025-04-18 19:48:12 -05:00
try base domain if others fail
This commit is contained in:
parent
5f79af2e18
commit
a564df42d6
@ -64,7 +64,17 @@ namespace Bit.Icons.Services
|
|||||||
uri = parsedHttpUri;
|
uri = parsedHttpUri;
|
||||||
response = await GetAndFollowAsync(uri, 2);
|
response = await GetAndFollowAsync(uri, 2);
|
||||||
|
|
||||||
if((response == null || !response.IsSuccessStatusCode) &&
|
if(response == null || !response.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
var dotCount = domain.Count(c => c == '.');
|
||||||
|
if(dotCount > 1 && DomainName.TryParseBaseDomain(domain, out var baseDomain) &&
|
||||||
|
Uri.TryCreate($"https://{baseDomain}", UriKind.Absolute, out var parsedBaseUri))
|
||||||
|
{
|
||||||
|
Cleanup(response);
|
||||||
|
uri = parsedBaseUri;
|
||||||
|
response = await GetAndFollowAsync(uri, 2);
|
||||||
|
}
|
||||||
|
else if(dotCount < 2 &&
|
||||||
Uri.TryCreate($"https://www.{parsedHttpsUri.Host}", UriKind.Absolute, out var parsedWwwUri))
|
Uri.TryCreate($"https://www.{parsedHttpsUri.Host}", UriKind.Absolute, out var parsedWwwUri))
|
||||||
{
|
{
|
||||||
Cleanup(response);
|
Cleanup(response);
|
||||||
@ -72,6 +82,7 @@ namespace Bit.Icons.Services
|
|||||||
response = await GetAndFollowAsync(uri, 2);
|
response = await GetAndFollowAsync(uri, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(response?.Content == null || !response.IsSuccessStatusCode)
|
if(response?.Content == null || !response.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user