mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
[svn] Send the Proxy-Authorization header over non-SSL connections too.
This commit is contained in:
parent
bf4ae09b22
commit
7488d701bf
@ -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>
|
2004-03-25 David Fritz <zeroxdf@att.net>
|
||||||
|
|
||||||
* mswindows.c (fake_fork_child): Ignore error code when
|
* mswindows.c (fake_fork_child): Ignore error code when
|
||||||
|
64
src/http.c
64
src/http.c
@ -1113,35 +1113,6 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
|
|||||||
|
|
||||||
conn = u;
|
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. */
|
/* Prepare the request to send. */
|
||||||
|
|
||||||
req = request_new ();
|
req = request_new ();
|
||||||
@ -1205,6 +1176,41 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
|
|||||||
rel_value);
|
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
|
/* Whether we need to print the host header with braces around
|
||||||
host, e.g. "Host: [3ffe:8100:200:2::2]:1234" instead of the
|
host, e.g. "Host: [3ffe:8100:200:2::2]:1234" instead of the
|
||||||
|
Loading…
Reference in New Issue
Block a user