1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-22 12:15:36 +01:00

catch errors when trying to resolve DNS (#841)

This commit is contained in:
Kyle Spearrin 2020-07-28 23:22:02 -04:00 committed by GitHub
parent aa1665065d
commit cf303f2f97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -292,8 +292,15 @@ namespace Bit.Icons.Services
}
// Resolve host to make sure it is not an internal/private IP address
var hostEntry = Dns.GetHostEntry(uri.Host);
if (hostEntry?.AddressList.Any(ip => IsInternal(ip)) ?? true)
try
{
var hostEntry = Dns.GetHostEntry(uri.Host);
if (hostEntry?.AddressList.Any(ip => IsInternal(ip)) ?? true)
{
return null;
}
}
catch
{
return null;
}