Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c1da0eb

Browse filesBrowse files
[HttpClient] Fix buffering after calling AsyncContext::passthru()
1 parent af6a777 commit c1da0eb
Copy full SHA for c1da0eb

File tree

Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed

‎src/Symfony/Component/HttpClient/Response/AsyncContext.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpClient/Response/AsyncContext.php
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,15 @@ public function replaceResponse(ResponseInterface $response): ResponseInterface
181181

182182
/**
183183
* Replaces or removes the chunk filter iterator.
184+
*
185+
* @param ?callable(ChunkInterface, self): ?\Iterator $passthru
184186
*/
185187
public function passthru(callable $passthru = null): void
186188
{
187-
$this->passthru = $passthru;
189+
$this->passthru = $passthru ?? static function ($chunk, $context) {
190+
$context->passthru = null;
191+
192+
yield $chunk;
193+
};
188194
}
189195
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.