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:
parent
aa1665065d
commit
cf303f2f97
@ -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())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user