mirror of
https://github.com/bitwarden/server.git
synced 2025-02-18 02:11:22 +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
|
// Resolve host to make sure it is not an internal/private IP address
|
||||||
|
try
|
||||||
|
{
|
||||||
var hostEntry = Dns.GetHostEntry(uri.Host);
|
var hostEntry = Dns.GetHostEntry(uri.Host);
|
||||||
if (hostEntry?.AddressList.Any(ip => IsInternal(ip)) ?? true)
|
if (hostEntry?.AddressList.Any(ip => IsInternal(ip)) ?? true)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
using (var message = new HttpRequestMessage())
|
using (var message = new HttpRequestMessage())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user