8000 Revert "bug #54517 [HttpClient] Let curl handle transfer encoding (mi… · symfony/symfony@cc61633 · GitHub
[go: up one dir, main page]

Skip to content

Commit cc61633

Browse files
Revert "bug #54517 [HttpClient] Let curl handle transfer encoding (michaelhue)"
This reverts commit de1409e, reversing changes made to 49e9184.
1 parent e79eea1 commit cc61633

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Symfony/Component/HttpClient/CurlHttpClient.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24 8772 6,8 +246,9 @@ 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-
} elseif (!isset($options['normalized_headers']['transfer-encoding'])) {
250-
$curlopts[\CURLOPT_INFILESIZE] = -1;
249+
}
250+
if (!isset($options['normalized_headers']['transfer-encoding'])) {
251+
$curlopts[\CURLOPT_HTTPHEADER][] = 'Transfer-Encoding:'.(isset($curlopts[\CURLOPT_INFILESIZE]) ? '' : ' chunked');
251252
}
252253

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

0 commit comments

Comments
 (0)
0