Bug #74800 [Fbk->NoF]: cURL Improperly Sets Proxy-Connect Header

From: Date: Sun, 07 Apr 2019 04:22:05 +0000
Subject: Bug #74800 [Fbk->NoF]: cURL Improperly Sets Proxy-Connect Header
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-220347@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74800&edit=1 ID: 74800 Updated by: php-bugs@lists.php.net Reported by: cmanalio at gmail dot com Summary: cURL Improperly Sets Proxy-Connect Header -Status: Feedback +Status: No Feedback Type: Bug Package: cURL related Operating System: Centos 6.9 PHP Version: 7.0.20 Private report: N New Comment: 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 "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2019-03-26 17:39:35] mike@php.net Thank you for taking the time to report a problem with PHP. Unfortunately you are not using a current version of PHP -- the problem might already be fixed. Please download a new PHP version from http://www.php.net/downloads.php If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PHP. ------------------------------------------------------------------------ [2017-06-22 19:36:34] cmanalio at gmail dot com Description: ------------ When using a proxy, the PHP Curl wrapper does not allow the user to remove or modify the Proxy-Connect header. PHP cURL will set a hard-coded "Proxy-Connect: Keep-alive" value, no matter if the user requests to disable this behavior by setting the header to null. Additionally, if the user would like to set "Proxy-Connect" to "Closed", this is impossible as cURL will still send the "Keep-Alive" header and append "Closed" afterwards, like so: "Proxy-Connect: Keep-alive, Closed" Test script: --------------- <?php //Proxy-Connection is not set, desired behavior is to remove this header from the request. The command line version of cURL does so properly, but PHP still sends it. $headers = array('Proxy-Connection:'); $ch = curl_init(); curl_setopt($ch, CURLOPT_PROXY, $GLOBALS['proxyserver']); curl_setopt($ch, CURLOPT_URL, "http://www.xhaus.com/headers"); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); var_dump($result); ?> Expected result: ---------------- HTTP Header* Value Accept */* Connection close Host www.xhaus.com User-Agent Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/29.0 Actual result: -------------- HTTP Header* Value Accept */* Connection close Host www.xhaus.com Proxy-Connection Keep-Alive User-Agent Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/29.0 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74800&edit=1

« previous php.bugs (#220347) next »