From e821f04ebef72d992ab623977b4d40d6ad5a8f21 Mon Sep 17 00:00:00 2001 From: Konstantin Grachev Date: Sat, 23 Jan 2021 02:16:05 +0300 Subject: [PATCH] Try to resolve hostname if no configured --- src/Connection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Connection.php b/src/Connection.php index f9b2a1c..a663b94 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -46,7 +46,7 @@ abstract class Connection $this->features = [ 'client_id' => $clientId ?? '', - 'hostname' => $hostname ?? '', + 'hostname' => $hostname ?? (static fn (mixed $host): string => \is_string($host) ? $host : '')(gethostname()), 'user_agent' => $userAgent ?? 'nsqphp/'.InstalledVersions::getPrettyVersion('nsq/nsq'), ];