Skip to content

Commit

Permalink
[HttpClient] Fix strict parsing of response status codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Armando authored and nicolas-grekas committed Jan 13, 2020
1 parent 986c424 commit aa662bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Response/ResponseTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ private static function initialize(self $response): void
private static function addResponseHeaders(array $responseHeaders, array &$info, array &$headers, string &$debug = ''): void
{
foreach ($responseHeaders as $h) {
if (11 <= \strlen($h) && '/' === $h[4] && preg_match('#^HTTP/\d+(?:\.\d+)? ([12345]\d\d) .*#', $h, $m)) {
if (11 <= \strlen($h) && '/' === $h[4] && preg_match('#^HTTP/\d+(?:\.\d+)? ([12345]\d\d)(?: |$)#', $h, $m)) {
if ($headers) {
$debug .= "< \r\n";
$headers = [];
Expand Down

0 comments on commit aa662bb

Please sign in to comment.