Edit report at https://bugs.php.net/bug.php?id=79013&edit=1
ID: 79013
Updated by: cmb@php.net
Reported by: christian at klemmer dot io
Summary: Content-Length missing when posting a curlFile with
curl
Status: Closed
Type: Bug
Package: cURL related
Operating System: debian 10.2
PHP Version: 7.4.1
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
> Is this caused by PHP or libcurl? You stated earlier that 7.64> might have a bug.
Indeed, this looks like a bug in libcurl 7.64.0.
Anyhow, the commit which landed yesterday explicitly passes the
length of the stream to libcurl (if the stream is seekable, and no
filters are attached), so this should even work with libcurl
7.64.0.
You can either test a snapshot, or wait for PHP 7.4.4RC1 which is
scheduled for Thursday.
Previous Comments:
------------------------------------------------------------------------
[2020-03-02 23:40:31] christian at klemmer dot io
Debian 10.3 - PHP 7.4.3 - CURL 7.64.0 (7.64.0-4):
-----------------------
POST / HTTP/2
Host: example.com
Accept: */*
Transfer-Encoding: chunked
Content-Type: multipart/form-data; boundary=------------------------1698b5ad232372f0
With debian buster and the current CURL-version of debian buster I get Transfer-Encoding: chunked
with HTTP/2, which is forbidden:
"HTTP/2 doesn't support HTTP 1.1's chunked transfer encoding mechanism, as it
provides its own, more efficient, mechanisms for data streaming."
(https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Transfer-Encoding)
Is this caused by PHP or libcurl? You stated earlier that 7.64 might have a bug. Still this is the
current libcurl-version of debian stable.
Making a HTTP/2 request with Transfer-Encoding: chunked won't receive the file for some
servers.
With libcurl 7.68.0-1 out of debian bullseye (testing) it's working as excepted.
Debian 10.3 - PHP 7.4.3 - CURL 7.68.0 (7.68.0-1):
-----------------------
POST / HTTP/2
Host: example.com
accept: */*
content-type: multipart/form-data; boundary=------------------------399326925cec236c
------------------------------------------------------------------------
[2020-03-02 18:13:37] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=fc8b3ab7cbb4f5e77584babeaf25b9bf16f524cd
Log: Fix #79013: Content-Length missing when posting a curlFile with curl
------------------------------------------------------------------------
[2020-03-02 18:01:16] cmb@php.net
> Is there any alternative to who is running with 7.4.3?
If you can enforce HTTP/2, that should be sufficient.
------------------------------------------------------------------------
[2020-03-02 15:10:53] carlospauluk at gmail dot com
Is there any alternative to who is running with 7.4.3?
------------------------------------------------------------------------
[2020-02-28 10:12:55] cmb@php.net
The following pull request has been associated:
Patch Name: Fix #79013: Content-Length missing when posting a curlFile with curl
On GitHub: https://github.com/php/php-src/pull/5219
Patch: https://github.com/php/php-src/pull/5219.patch
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=79013
--
Edit this bug report at https://bugs.php.net/bug.php?id=79013&edit=1