Skip to content

Commit 4aa9536

Browse files
Armandonicolas-grekas
Armando
authored andcommitted
[HttpClient] Fix strict parsing of response status codes
1 parent 1d25a25 commit 4aa9536

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/HttpClient/Response/ResponseTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ private static function initialize(self $response): void
223223
private static function addResponseHeaders(array $responseHeaders, array &$info, array &$headers, string &$debug = ''): void
224224
{
225225
foreach ($responseHeaders as $h) {
226-
if (11 <= \strlen($h) && '/' === $h[4] && preg_match('#^HTTP/\d+(?:\.\d+)? ([12345]\d\d) .*#', $h, $m)) {
226+
if (11 <= \strlen($h) && '/' === $h[4] && preg_match('#^HTTP/\d+(?:\.\d+)? ([12345]\d\d)(?: |$)#', $h, $m)) {
227227
if ($headers) {
228228
$debug .= "< \r\n";
229229
$headers = [];

0 commit comments

Comments
 (0)