Skip to content

Commit 6c3d1e4

Browse files
authored
Merge pull request #239 from AikidoSec/gethostentry-catch-exception
Default to "unknown" if no server ip address found
2 parents 44ed1c8 + 0db1186 commit 6c3d1e4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Aikido.Zen.Core/Helpers/IPHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ public static string Server
7171
{
7272
IPHostEntry ipHostInfo = Dns.GetHostEntry(Dns.GetHostName());
7373
IPAddress ipAddress = ipHostInfo.AddressList.FirstOrDefault(ip => ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork);
74-
return ipAddress?.ToString() ?? "127.0.0.1";
74+
return ipAddress?.ToString() ?? "";
7575
}
7676
catch (Exception)
7777
{
7878
// GetHostEntry can throw "SocketException: nodename nor servname provided, or not known"
79-
return "127.0.0.1";
79+
return "";
8080
}
8181
}
8282
}

0 commit comments

Comments
 (0)