Remove usage of http_parse_message

Found a case where http_parse_message failed to parse a valid request header and returned null, which ended up in an uncaught exception being thrown by Guzzle.
This commit is contained in:
Chris Boden 2017-09-13 18:12:50 -04:00
parent 0cde24bae7
commit fe4a97400d

View File

@ -59,18 +59,6 @@ class HttpRequestParser implements MessageInterface {
* @return \Psr\Http\Message\RequestInterface
*/
public function parse($headers) {
if (function_exists('http_parse_message')) {
$parts = http_parse_message($headers);
return new gPsr\Request(
$parts->requestMethod
, $parts->requestUrl
, $parts->headers
, null
, $parts->httpVersion
);
} else {
return gPsr\parse_request($headers);
}
return gPsr\parse_request($headers);
}
}