curl-users
Re: HTTP_PROXY bug?
Date: Mon, 10 Dec 2001 11:57:01 +0100 (MET)
On Mon, 10 Dec 2001, Björn Stenberg wrote:
> I can't get curl (7.8) to use the HTTP_PROXY environment variable. Very
> strange:
>
> $ env | grep PROXY
> HTTP_PROXY=int-proxy1:8080
> FTP_PROXY=postal:8080
> $ curl -I http://curl.haxx.se
> <nothing happens for 10-15 seconds, so I press Ctrl-C>
[snip]
> So ALL_PROXY and the -x option works, but not HTTP_PROXY?
Yes. That's actually the expected behavior, believe it or not! ;-)
The variable "HTTP_PROXY", using all caps, is no longer permitted/understood
(since 7.7.2 actually). Here's why:
When CGI scripts get executed from within web servers, they usually get
environment variables set before the script is executed. Headers in the
incoming request that activate the script get converted to variables named
HTTP_[header].
So, if anyone wrote a CGI script that in turn was using curl, you could
actually trick curl to use a http proxy of your choice by passing a 'Proxy:
[yada yada]' header.
http_proxy', using lower case, on the other hand is perfectly understood by
curl.
-- Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/Received on 2001-12-10