From 560f1fd9fd465a91562090c35c9ca4837abc736d Mon Sep 17 00:00:00 2001 From: Ali Farmad Date: Mon, 25 May 2020 22:09:12 +0430 Subject: [PATCH] fix connectionResponse parts fix connectionResponse parts (auth_required, tls_required, tls_verify) --- src/Nats/ServerInfo.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Nats/ServerInfo.php b/src/Nats/ServerInfo.php index e1e86c7..c4c2a4f 100644 --- a/src/Nats/ServerInfo.php +++ b/src/Nats/ServerInfo.php @@ -96,6 +96,18 @@ public function __construct($connectionResponse) { $parts = explode(' ', $connectionResponse); $data = json_decode($parts[1], true); + + if (!isset($data['auth_required'])) { + $data['auth_required'] = false; + } + + if (!isset($data['tls_required'])) { + $data['tls_required'] = false; + } + + if (!isset($data['tls_verify'])) { + $data['tls_verify'] = false; + } $this->setServerID($data['server_id']); $this->setHost($data['host']);