[WebSocket] Only select one sub-protocol, fixes #103
This commit is contained in:
parent
e9d19c95ab
commit
bb0896ab12
16
WsServer.php
16
WsServer.php
@ -199,19 +199,15 @@ class WsServer implements HttpServerInterface {
|
|||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function getSubProtocolString(\Traversable $requested = null) {
|
protected function getSubProtocolString(\Traversable $requested = null) {
|
||||||
if (null === $requested) {
|
if (null !== $requested) {
|
||||||
return '';
|
foreach ($requested as $sub) {
|
||||||
}
|
if ($this->isSubProtocolSupported($sub)) {
|
||||||
|
return $sub;
|
||||||
$result = array();
|
}
|
||||||
|
|
||||||
foreach ($requested as $sub) {
|
|
||||||
if ($this->isSubProtocolSupported($sub)) {
|
|
||||||
$result[] = $sub;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return implode(',', $result);
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user