8000 bug #38682 [HttpClient] never trace content of event-stream responses… · symfony/symfony@6f0a897 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6f0a897

Browse files
committed
bug #38682 [HttpClient] never trace content of event-stream responses (nicolas-grekas)
This PR was merged into the 5.x branch. Discussion ---------- [HttpClient] never trace content of event-stream responses | Q | A | ------------- | --- | Branch? | 5.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Let's leverage #38587 in `EventSourceHttpClient` Commits ------- e4c0262 [HttpClient] never trace content of event-stream responses
2 parents e2f0454 + e4c0262 commit 6f0a897

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/HttpClient/EventSourceHttpClient.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ public function request(string $method, string $url, array $options = []): Respo
6060

6161
if ($accept = self::normalizeHeaders($options['headers'] ?? [])['accept'] ?? []) {
6262
$state->buffer = \in_array($accept, [['Accept: text/event-stream'], ['accept: text/event-stream']], true) ? '' : null;
63+
64+
if (null !== $state->buffer) {
65+
$options['extra']['trace_content'] = false;
66+
}
6367
}
6468

6569
return new AsyncResponse($this->client, $method, $url, $options, static function (ChunkInterface $chunk, AsyncContext $context) use ($state, $method, $url, $options) {

0 commit comments

Comments
 (0)
0