1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-25 12:45:18 +01:00

TryCreate uri first

This commit is contained in:
Kyle Spearrin 2018-06-28 10:15:54 -04:00
parent 3ff217bb24
commit 4dfef9fa96

View File

@ -50,7 +50,12 @@ namespace Bit.Icons.Services
public async Task<IconResult> GetIconAsync(string domain)
{
var uri = new Uri($"https://{domain}");
if(!Uri.TryCreate($"https://{domain}", UriKind.Absolute, out var parsedUri))
{
return null;
}
var uri = parsedUri;
var response = await GetAndFollowAsync(uri, 2);
if(response == null || !response.IsSuccessStatusCode)
{