Bug #79013 [Com]: Content-Length missing when posting a curlFile with curl

From: Date: Mon, 02 Mar 2020 23:40:31 +0000
Subject: Bug #79013 [Com]: Content-Length missing when posting a curlFile with curl
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-225847@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79013&edit=1

 ID:                 79013
 Comment by:         christian at klemmer dot io
 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:

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


Previous Comments:
------------------------------------------------------------------------
[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

------------------------------------------------------------------------
[2020-02-20 12:41:43] cmb@php.net

Related To: Bug #79289

------------------------------------------------------------------------


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


Thread (22 messages)

« previous php.bugs (#225847) next »