Skip to content

Commit

Permalink
Work around HHVM being unable to parse URIs with query but no path
Browse files Browse the repository at this point in the history
  • Loading branch information
clue committed Mar 11, 2017
1 parent 7c91c7a commit f797b6a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/TcpConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ public function connect($uri)
}
}

// HHVM fails to parse URIs with a query but no path, so let's add a dummy path
// See also https://3v4l.org/jEhLF
if (defined('HHVM_VERSION') && isset($parts['query']) && !isset($parts['path'])) {
$uri = str_replace('?', '/?', $uri);
}

$socket = @stream_socket_client(
$uri,
$errno,
Expand Down

0 comments on commit f797b6a

Please sign in to comment.