]> sjero.net Git - wget/commitdiff
[svn] Send the Proxy-Authorization header over non-SSL connections too.
authorhniksic <devnull@localhost>
Tue, 30 Mar 2004 23:19:16 +0000 (15:19 -0800)
committerhniksic <devnull@localhost>
Tue, 30 Mar 2004 23:19:16 +0000 (15:19 -0800)
src/ChangeLog
src/http.c

index 9b90176c1e2cb61c48b9f3704e321f767c1fe468..e7a692618049d181a6d04966c5044e79a8ee0971 100644 (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
index dec5f0267b220d8987878f6b0dd59d0e8c535f68..dfb7c00204084172c622af9c42cb389627949095 100644 (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