diff --git a/src/Handshake/ClientNegotiator.php b/src/Handshake/ClientNegotiator.php index 547b5ea..62d21e5 100644 --- a/src/Handshake/ClientNegotiator.php +++ b/src/Handshake/ClientNegotiator.php @@ -23,7 +23,7 @@ public function __construct( ->createRequest('GET', '') ->withHeader('Connection' , 'Upgrade') ->withHeader('Upgrade' , 'websocket') - ->withHeader('Sec-WebSocket-Version', $this->getVersion()) + ->withHeader('Sec-WebSocket-Version', (string)$this->getVersion()) ->withHeader('User-Agent' , 'Ratchet'); $perMessageDeflateOptions ??= PermessageDeflateOptions::createDisabled(); diff --git a/src/Handshake/ServerNegotiator.php b/src/Handshake/ServerNegotiator.php index 94f0549..656c7d9 100644 --- a/src/Handshake/ServerNegotiator.php +++ b/src/Handshake/ServerNegotiator.php @@ -79,7 +79,7 @@ public function handshake(RequestInterface $request): ResponseInterface { $upgradeResponse = $response ->withHeader('Connection' , 'Upgrade') ->withHeader('Upgrade' , 'websocket') - ->withHeader('Sec-WebSocket-Version', $this->getVersionNumber()); + ->withHeader('Sec-WebSocket-Version', (string)$this->getVersionNumber()); if (count($this->_supportedSubProtocols) > 0) { $upgradeResponse = $upgradeResponse->withHeader(