10000 [HttpClient] Let curl handle transfer encoding · symfony/http-client@ead44ee · GitHub
[go: up one dir, main page]

Skip to content

Commit ead44ee

Browse files
michaelhuenicolas-grekas
authored andcommitted
[HttpClient] Let curl handle transfer encoding
1 parent ab3240a commit ead44ee

File tree

< 8000 div class="d-flex flex-items-center flex-justify-between gap-2 pt-3 pt-lg-4 pb-2 position-sticky top-0 color-bg-default" style="z-index:2">

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

CurlHttpClient.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,8 @@ public function request(string $method, string $url, array $options = []): Respo
246246

247247
if (isset($options['normalized_headers']['content-length'][0])) {
248248
$curlopts[\CURLOPT_INFILESIZE] = (int) substr($options['normalized_headers']['content-length'][0], \strlen('Content-Length: '));
249-
}
250-
if (!isset($options['normalized_headers']['transfer-encoding'])) {
251-
$curlopts[\CURLOPT_HTTPHEADER][] = 'Transfer-Encoding:'.(isset($curlopts[\CURLOPT_INFILESIZE]) ? '' : ' chunked');
249+
} elseif (!isset($options['normalized_headers']['transfer-encoding'])) {
250+
$curlopts[\CURLOPT_INFILESIZE] = -1;
252251
}
253252

254253
if ('POST' !== $method) {

0 commit comments

Comments
 (0)
0