Skip to content

Commit fac85e1

Browse files
HttpClientRequestIdLogger fix with timeout chunks
1 parent 49b9833 commit fac85e1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/HttpClient/HttpClientRequestIdLogger.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ public function __construct(
2828
public function request(string $method, string $url, array $options = []): ResponseInterface
2929
{
3030
return new AsyncResponse($this->client, $method, $url, $options, function (ChunkInterface $chunk, AsyncContext $asyncContext) {
31+
if ($chunk->isTimeout() || null !== $chunk->getInformationalStatus() || $asyncContext->getInfo('canceled')) {
32+
yield $chunk;
33+
34+
return;
35+
}
36+
3137
if ($chunk->isFirst()) {
3238
$headers = $asyncContext->getHeaders();
3339

0 commit comments

Comments
 (0)