php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61346 CURL_HTTP_VERSION_1_0 bypassed when using CURLINFO_HEADER_OUT
Submitted: 2012-03-11 00:29 UTC Modified: 2013-01-21 09:25 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: l dot declercq at nuxwin dot com Assigned:
Status: Not a bug Package: cURL related
PHP Version: Irrelevant OS: Debian Squeeze
Private report: No CVE-ID: None
 [2012-03-11 00:29 UTC] l dot declercq at nuxwin dot com
Description:
------------
When using the CURLINFO_HEADER_OUT option HTTP version option seem to be bypassed (1.1 is forced)

Test script:
---------------
// ...

curl_setopt($curlSession, CURLINFO_HEADER_OUT, true);

// Mark as HTTP request
curl_setopt($curlSession, CURL_HTTP_VERSION_1_0, true);

// ...

// Send the request
$response = curl_exec($curlSession);
$request  = curl_getinfo($curlSession, CURLINFO_HEADER_OUT);

echo $request

Expected result:
----------------
// kind of

GET /rest.php?wsid=boxbilling&method=sayHello&name=Declercq%20Lau%3Frent HTTP/1.0
Accept: */*
X-Requested-With: RestHttpRequest
Host: imscp.i-mscp.net
Connection: close
Accept-encoding: identity
User-Agent: iMSCP_Rest_Client
Authorization: Basic YWRtaW4xOmFkbWluMQ==

Actual result:
--------------
GET /rest.php?wsid=boxbilling&method=sayHello&name=Declercq%20Lau%3Frent HTTP/1.1
Accept: */*
X-Requested-With: RestHttpRequest
Host: imscp.i-mscp.net
Connection: close
Accept-encoding: identity
User-Agent: iMSCP_Rest_Client
Authorization: Basic YWRtaW4xOmFkbWluMQ==

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-11 17:54 UTC] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

The change is triggered by libcurl not PHP.
 [2012-03-11 17:54 UTC] iliaa@php.net
-Status: Open +Status: Not a bug
 [2013-01-21 09:25 UTC] datibbaw@php.net
Also, the syntax is not correct; it should be:

curl_setopt($curlSession, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC