
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
15 lines
386 B
PHP
15 lines
386 B
PHP
<?php
|
|
namespace Ratchet\WebSocket\Version;
|
|
use Guzzle\Http\Message\RequestInterface;
|
|
|
|
class HyBi10 extends RFC6455 {
|
|
public function isProtocol(RequestInterface $request) {
|
|
$version = (int)((string)($request->getHeader('Sec-WebSocket-Version', -1)));
|
|
return ($version >= 6 && $version < 13);
|
|
}
|
|
|
|
public function getVersionNumber() {
|
|
return 6;
|
|
}
|
|
}
|