PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTTP » HTTP_Request » Bug #5913

Proxy-Authentication header not added

Details

Submitted2005-11-10 00:48 UTC
Fromeru at php dot net
Assignedavb
StatusClosed
PackageHTTP_Request
PHP VersionIrrelevant
OSIrrelevant
Roadmaps(Not assigned)

Comments

[2005-11-10 00:48 UTC] eru at php dot net

Description:
------------
(HTTP_Request 1.3.0)

When proxy-information is passed as parameters to the class-constructor, the Proxy-Authentication header is left out, whereas using the setProxy() function properly adds it. See patch below.

Test script:
---------------
--- Request.php.bak Tue Nov 08 14:54:26 2005
+++ Request.php Thu Nov 10 01:33:33 2005
@@ -278,6 +278,11 @@
$this->addHeader('Authorization', 'Basic ' . base64_encode($this->_user . ':' . $this->_pass));
}

+ // Proxy authentication
+ if (!empty($this->_proxy_user)) {
+ $this->addHeader('Proxy-Authorization', 'Basic ' . base64_encode($this->_proxy_user . ':' . $this->_proxy_pass));
+ }
+
// Use gzip encoding if possible
// Avoid gzip encoding if using multibyte functions (see #1781)
if (HTTP_REQUEST_HTTP_VER_1_1 == $this->_http && extension_loaded('zlib') &&

[2005-11-10 01:02 UTC] eru at php dot net

One other thing: SOAP_WSDL is already working around this bug (lines 918-927) and I'm wondering why they didn't post a report at the time they encountered it. Anyway, you should give them a heads-up when applying the fix, otherwise the header gets added twice. Dunno about other classes.

[2006-06-07 13:06 UTC] webmaster at east dot in dot ua

found the same problem.
previous comment says 'patch applied', but in HTTP_Request 1.3.0 stable there is no code to handle proxy-auth....
Did I miss something or the patch is _not_ applied?