php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63894 incorrect CURLINFO_HEADER_SIZE for proxied connections
Submitted: 2013-01-03 16:18 UTC Modified: 2013-03-06 20:39 UTC
From: josh at trash-mail dot com Assigned: mj (profile)
Status: Closed Package: cURL related
PHP Version: 5.4.10 OS: irrelevant
Private report: No CVE-ID: None
 [2013-01-03 16:18 UTC] josh at trash-mail dot com
Description:
------------
When using CURLOPT_PROXY to connect to an HTTPS resource via an HTTP debugging 
proxy (like charles) CURLINFO_HEADER_SIZE incorrectly reports the header size 
without any headers that the proxy might have added.

Example #1 (without proxy) reports CURLINFO_HEADER_SIZE 198 (correct):
######
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Date: Thu, 03 Jan 2013 15:54:35 GMT
Server: Apache/2.2.22 (Amazon)
X-Powered-By: PHP/5.3.19
Content-Length: 15
Connection: Keep-alive
######


Example #2 (via proxy) reports CURLINFO_HEADER_SIZE 198 (wrong):
######
HTTP/1.0 200 Connection established

HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Date: Thu, 03 Jan 2013 15:54:35 GMT
Server: Apache/2.2.22 (Amazon)
X-Powered-By: PHP/5.3.19
Content-Length: 15
Connection: Keep-alive
######


Expected result:
----------------
CURLINFO_HEADER_SIZE should always return the correct size - also when 
CURLOPT_PROXY is used with an HTTP proxy to connect an HTTPS resource.

Actual result:
--------------
CURLINFO_HEADER_SIZE returns the wrong size (without counting the additional 
headers from the proxy).

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-01-04 07:15 UTC] pierrick@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2013-01-04 07:15 UTC] pierrick@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: pierrick
 [2013-02-18 00:36 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 [2013-03-06 20:34 UTC] mj@php.net
The LICENSE file has been updated as well. Thanks for your report.
 [2013-03-06 20:34 UTC] mj@php.net
-Summary: incorrect CURLINFO_HEADER_SIZE for proxied connections +Summary: Outdated copyright notice in snaps.php.net footer -Operating System: +Operating System: irrelevant -PHP Version: 5.4.10 +PHP Version: Irrelevant -Assigned To: pierrick +Assigned To: mj
 [2013-03-06 20:37 UTC] mj@php.net
-Summary: Outdated copyright notice in snaps.php.net footer +Summary: incorrect CURLINFO_HEADER_SIZE for proxied connections -PHP Version: Irrelevant +PHP Version: 5.4.10
 [2013-03-06 20:37 UTC] mj@php.net
Sorry for the mess.
 [2013-03-06 20:39 UTC] mj@php.net
-Status: No Feedback +Status: Closed
 [2013-03-06 20:39 UTC] mj@php.net
This issue actually stems from a bug in libcurl. I have submitted a pull request 
for a change to upstream at https://github.com/bagder/curl/pull/60/commits.

There is really not much that can be done within PHP because we are essentially 
only passing data back and forth between user-land and cURL. Folks affected by 
this simply need to wait for libcurl to be fixed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 18:01:31 2024 UTC