Skip to content

Commit a45fa15

Browse files
[HttpClient] accept headers when CURLE_RECV_ERROR is received before the content
1 parent 6b900ff commit a45fa15

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Response/CurlResponse.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,10 @@ private static function perform(ClientState $multi, array &$responses = null): v
290290
}
291291
}
292292

293+
if (\CURLE_RECV_ERROR === $result && 'H' === $waitFor[0] && 400 <= ($responses[(int) $ch]->info['http_code'] ?? 0)) {
294+
$multi->handlesActivity[$id][] = new FirstChunk();
295+
}
296+
293297
$multi->handlesActivity[$id][] = null;
294298
$multi->handlesActivity[$id][] = \in_array($result, [\CURLE_OK, \CURLE_TOO_MANY_REDIRECTS], true) || '_0' === $waitFor || curl_getinfo($ch, \CURLINFO_SIZE_DOWNLOAD) === curl_getinfo($ch, \CURLINFO_CONTENT_LENGTH_DOWNLOAD) ? null : new TransportException(sprintf('%s for "%s".', curl_strerror($result), curl_getinfo($ch, \CURLINFO_EFFECTIVE_URL)));
295299
}

0 commit comments

Comments
 (0)