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:
parent
3ff217bb24
commit
4dfef9fa96
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user