Skip to content

Commit

Permalink
Merge pull request #126 from mbabker/upgrade-psr7
Browse files Browse the repository at this point in the history
Allow use of guzzlehttp/psr7:^2.0

fixes #132
  • Loading branch information
cboden authored Dec 10, 2021
2 parents 31769d2 + 42e299c commit 65874e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
, "require": {
"php": ">=5.4"
, "evenement/evenement": "^3.0 || ^2.0"
, "ratchet/rfc6455": "^0.3"
, "guzzlehttp/psr7": "^2.0 || ^1.7"
, "ratchet/rfc6455": "^0.3.1"
, "react/socket": "^1.9"
}
, "require-dev": {
Expand Down
8 changes: 4 additions & 4 deletions src/Connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ public function __invoke($url, array $subProtocols = [], array $headers = []) {

$stream->removeListener('data', $headerParser);

$response = gPsr\parse_response($buffer);
$response = gPsr\Message::parseResponse($buffer);

if (!$this->_negotiator->validateResponse($request, $response)) {
$futureWsConn->reject(new \DomainException(gPsr\str($response)));
$futureWsConn->reject(new \DomainException(gPsr\Message::toString($response)));
$stream->close();

return;
Expand All @@ -110,7 +110,7 @@ public function __invoke($url, array $subProtocols = [], array $headers = []) {
};

$stream->on('data', $headerParser);
$stream->write(gPsr\str($request));
$stream->write(gPsr\Message::toString($request));
}, array($futureWsConn, 'reject'));

return $futureWsConn->promise();
Expand All @@ -124,7 +124,7 @@ public function __invoke($url, array $subProtocols = [], array $headers = []) {
* @return \Psr\Http\Message\RequestInterface
*/
protected function generateRequest($url, array $subProtocols, array $headers) {
$uri = gPsr\uri_for($url);
$uri = gPsr\Utils::uriFor($url);

$scheme = $uri->getScheme();

Expand Down

0 comments on commit 65874e5

Please sign in to comment.