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:
commit
c8dbd1ad75
@ -245,7 +245,7 @@ final class CurlHttpClient implements HttpClientInterface, LoggerAwareInterface
|
|||||||
if ('POST' !== $method) {
|
if ('POST' !== $method) {
|
||||||
$curlopts[CURLOPT_UPLOAD] = true;
|
$curlopts[CURLOPT_UPLOAD] = true;
|
||||||
}
|
}
|
||||||
} elseif ('' !== $body) {
|
} elseif ('' !== $body || 'POST' === $method) {
|
||||||
$curlopts[CURLOPT_POSTFIELDS] = $body;
|
$curlopts[CURLOPT_POSTFIELDS] = $body;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user