[svn] Send the Proxy-Authorization header over non-SSL connections too.

This commit is contained in:
hniksic 2004-03-30 15:19:16 -08:00
parent bf4ae09b22
commit 7488d701bf
2 changed files with 40 additions and 29 deletions

View File

@ -1,3 +1,8 @@
2004-03-30 Hrvoje Niksic <hniksic@xemacs.org>
* http.c (gethttp): Send the Proxy-Authorization header over
non-SSL connections too.
2004-03-25 David Fritz <zeroxdf@att.net>
* mswindows.c (fake_fork_child): Ignore error code when

View File

@ -1113,35 +1113,6 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
conn = u;
proxyauth = NULL;
if (proxy)
{
char *proxy_user, *proxy_passwd;
/* For normal username and password, URL components override
command-line/wgetrc parameters. With proxy
authentication, it's the reverse, because proxy URLs are
normally the "permanent" ones, so command-line args
should take precedence. */
if (opt.proxy_user && opt.proxy_passwd)
{
proxy_user = opt.proxy_user;
proxy_passwd = opt.proxy_passwd;
}
else
{
proxy_user = proxy->user;
proxy_passwd = proxy->passwd;
}
/* #### This does not appear right. Can't the proxy request,
say, `Digest' authentication? */
if (proxy_user && proxy_passwd)
proxyauth = basic_authentication_encode (proxy_user, proxy_passwd);
/* If we're using a proxy, we will be connecting to the proxy
server. */
conn = proxy;
}
/* Prepare the request to send. */
req = request_new ();
@ -1205,6 +1176,41 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
rel_value);
}
proxyauth = NULL;
if (proxy)
{
char *proxy_user, *proxy_passwd;
/* For normal username and password, URL components override
command-line/wgetrc parameters. With proxy
authentication, it's the reverse, because proxy URLs are
normally the "permanent" ones, so command-line args
should take precedence. */
if (opt.proxy_user && opt.proxy_passwd)
{
proxy_user = opt.proxy_user;
proxy_passwd = opt.proxy_passwd;
}
else
{
proxy_user = proxy->user;
proxy_passwd = proxy->passwd;
}
/* #### This does not appear right. Can't the proxy request,
say, `Digest' authentication? */
if (proxy_user && proxy_passwd)
proxyauth = basic_authentication_encode (proxy_user, proxy_passwd);
/* If we're using a proxy, we will be connecting to the proxy
server. */
conn = proxy;
/* Proxy authorization over SSL is handled below. */
#ifdef HAVE_SSL
if (u->scheme != SCHEME_SSL)
#endif
request_set_header (req, "Proxy-Authorization", proxyauth, rel_value);
}
{
/* Whether we need to print the host header with braces around
host, e.g. "Host: [3ffe:8100:200:2::2]:1234" instead of the