|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68149 duplicate content-length
Submitted: 2014-10-03 21:14 UTC Modified: 2014-11-05 19:46 UTC
From: kontakt at kukulich dot cz Assigned: mike (profile)
Status: Closed Package: pecl_http (PECL)
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: kontakt at kukulich dot cz
New email:
PHP Version: OS:


 [2014-10-03 21:14 UTC] kontakt at kukulich dot cz
PUT methods doesn't work with cURL 7.19.7 (CentOS 6.4) because of duplicated header "Content-Length". Nginx refuses to process request and sends "400 Bad Request". It works with cURL 7.36.0 (Windows 7) or 7.38.0-2 (Arch Linux).

Sent headers:
PUT /file.ico HTTP/1.1
User-Agent: PECL_HTTP/2.1.2 PHP/5.5.17 libcurl/7.19.7
Host: webdav.local
Accept: */*
Content-Length: 15086
Content-Length: 15086

Test script:

$host = 'webdav.local';
$file = 'file.ico';

$data = file_get_contents($file);

$httpClient = new \http\Client();

$httpRequestBody1 = new \http\Message\Body();

$httpRequest1 = new \http\Client\Request('PUT', $host . '/file.ico');
$httpRequest1->setHeader('Expect', '');

$httpResponse1 = $httpClient->getResponse();

echo sprintf("%s:%s\n", $httpResponse1->getResponseCode(), $httpResponse1->getResponseStatus()); 

Expected result:

Actual result:
400:Bad Request


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-11-05 19:46 UTC]
-Summary: PUT method not working with cURL 7.19.7 +Summary: duplicate content-length -Assigned To: +Assigned To: mike
 [2014-11-05 19:46 UTC]
According to the curl changelog, this may fail until 7.23.
 [2014-11-06 12:07 UTC]
Automatic comment on behalf of mike
Log: Fixed bug #68149 (duplicate content-length with libcurl &lt; 7.23)
 [2014-11-06 12:07 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 25 05:01:29 2024 UTC