bug #33727 [HttpClient] workaround bad Content-Length sent by old libcurl (nicolas-grekas)

This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] workaround bad Content-Length sent by old libcurl

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Issue described in https://curl.haxx.se/mail/lib-2014-01/0106.html, happens with curl 7.29 at least.

Commits
-------

b8d2496979 [HttpClient] workaround bad Content-Length sent by old libcurl
This commit is contained in:
Nicolas Grekas 2019-09-26 23:18:02 +02:00
commit c8dbd1ad75

View File

@ -245,7 +245,7 @@ final class CurlHttpClient implements HttpClientInterface, LoggerAwareInterface
if ('POST' !== $method) {
$curlopts[CURLOPT_UPLOAD] = true;
}
} elseif ('' !== $body) {
} elseif ('' !== $body || 'POST' === $method) {
$curlopts[CURLOPT_POSTFIELDS] = $body;
}