From 3158e4fcf390f1bc6eda8c79783666a34bdfbce8 Mon Sep 17 00:00:00 2001 From: Barbarrosa Date: Fri, 31 May 2013 23:08:27 -0600 Subject: [PATCH] Update HyBi10.php I encountered the following error while attempting to use Ratchet. The __toString version of the request should contain the proper value, and retrieving the string before converting to an int would prevent this typecasting issue. Notice: Object of class Guzzle\Http\Message\Header could not be converted to int in [file system path]\vendor\cboden\ratchet\src\Ratchet\WebSocket\Version\HyBi10.php on line 7 --- Version/HyBi10.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Version/HyBi10.php b/Version/HyBi10.php index f557a18..0ac41fa 100644 --- a/Version/HyBi10.php +++ b/Version/HyBi10.php @@ -4,11 +4,11 @@ use Guzzle\Http\Message\RequestInterface; class HyBi10 extends RFC6455 { public function isProtocol(RequestInterface $request) { - $version = (int)$request->getHeader('Sec-WebSocket-Version', -1); + $version = (int)((string)($request->getHeader('Sec-WebSocket-Version', -1))); return ($version >= 6 && $version < 13); } public function getVersionNumber() { return 6; } -} \ No newline at end of file +}