Skip to content

Commit 1560d7f

Browse files
[HttpClient] never trace content of event-stream responses
1 parent d3721c5 commit 1560d7f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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)