mirror of
https://github.com/bitwarden/server.git
synced 2025-04-08 06:28:14 -05: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)
|
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);
|
var response = await GetAndFollowAsync(uri, 2);
|
||||||
if(response == null || !response.IsSuccessStatusCode)
|
if(response == null || !response.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user