Guzzle 3.6 conformance

Updated inheritance class to match API change
Use new Guzzle Header class when searching for values
Lock Ratchet into using Guzzle 3.6 to future-proof
This commit is contained in:
Chris Boden 2013-06-09 11:10:22 -04:00
parent 86e2484dfe
commit cb6f580d02
2 changed files with 5 additions and 4 deletions

View File

@ -7,7 +7,7 @@ class RequestFactory extends GuzzleRequestFactory {
/**
* {@inheritdoc}
*/
public function create($method, $url, $headers = null, $body = '') {
public function create($method, $url, $headers = null, $body = '', array $options = array()) {
$c = $this->entityEnclosingRequestClass;
$request = new $c($method, $url, $headers);
$request->setBody(EntityBody::factory($body));

View File

@ -117,9 +117,10 @@ class WsServer implements MessageComponentInterface {
return;
}
// This needs to be refactored later on, incorporated with routing
if ('' !== ($agreedSubProtocols = $this->getSubProtocolString($from->WebSocket->request->getTokenizedHeader('Sec-WebSocket-Protocol', ',')))) {
$response->setHeader('Sec-WebSocket-Protocol', $agreedSubProtocols);
if (null !== ($subHeader = $from->WebSocket->request->getHeader('Sec-WebSocket-Protocol'))) {
if ('' !== ($agreedSubProtocols = $this->getSubProtocolString($subHeader->normalize()))) {
$response->setHeader('Sec-WebSocket-Protocol', $agreedSubProtocols);
}
}
$response->setHeader('X-Powered-By', \Ratchet\VERSION);