PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTTP » HTTP_Request » Bug #5966

trying to get page through proxy when the request's server is a loopback

Details

Request #5966trying to get page through proxy when the request's server is a loopback
Submitted2005-11-15 10:32 UTC
Fromptc1982 at ifrance dot com
StatusWont fix
PackageHTTP_Request
PHP Version5.0.0
OSwin 2000
Roadmaps(Not assigned)

Comments

[2005-11-15 10:32 UTC] ptc1982 at ifrance dot com

Description:
------------
sendRequest function don't check if the server of the url requested is a loopback (localhost or 127.0.0.1).
So proxy server send a Connexion refused (503).

Test script:
---------------
define( 'PROXYNAME', 'proxy.example.com' );
define( 'PROXYPORT', '3128' );

$urlComplete = "http://127.0.0.1/foo.txt";
$req = &new HTTP_Request($urlComplete);
$req->setMethod(HTTP_REQUEST_METHOD_GET);
$req->setProxy(PROXYNAME,PROXYPORT);
$x = $req->sendRequest();
if (PEAR::isError($x)) {
echo "Problem";
die('');
}
if( $req->getResponseCode() == 503 ){
echo "connexion refused";
die('');
}
echo "get on localhost";

Expected result:
----------------
result of the script above
"get on localhost"

HTTP request must skip proxy server if 127.0.0.1

Actual result:
--------------
result of the script above
"connexion refused"

[2005-11-15 14:15 UTC] ptc1982 at ifrance dot com

ok, thanks you.
Sorry, for the inconvenience.