Merge branch 'handshake-fix'

This commit is contained in:
Chris Boden 2015-12-19 15:49:36 -05:00
commit 2bad474620

View File

@ -102,14 +102,14 @@ class WsServer implements HttpServerInterface {
protected function attemptUpgrade(ConnectionInterface $conn, $data = '') { protected function attemptUpgrade(ConnectionInterface $conn, $data = '') {
if ('' !== $data) { if ('' !== $data) {
$conn->WebSocket->request->getBody()->write($data); $conn->WebSocket->request->getBody()->write($data);
} else {
if (!$this->versioner->isVersionEnabled($conn->WebSocket->request)) {
return $this->close($conn);
}
$conn->WebSocket->version = $this->versioner->getVersion($conn->WebSocket->request);
} }
if (!$this->versioner->isVersionEnabled($conn->WebSocket->request)) {
return $this->close($conn);
}
$conn->WebSocket->version = $this->versioner->getVersion($conn->WebSocket->request);
try { try {
$response = $conn->WebSocket->version->handshake($conn->WebSocket->request); $response = $conn->WebSocket->version->handshake($conn->WebSocket->request);
} catch (\UnderflowException $e) { } catch (\UnderflowException $e) {