1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-26 12:55:17 +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,11 +292,18 @@ namespace Bit.Icons.Services
}
// Resolve host to make sure it is not an internal/private IP address
try
{
var hostEntry = Dns.GetHostEntry(uri.Host);
if (hostEntry?.AddressList.Any(ip => IsInternal(ip)) ?? true)
{
return null;
}
}
catch
{
return null;
}
using (var message = new HttpRequestMessage())
{