]> sjero.net Git - wget/commitdiff
[svn] Don't include the Proxy-Authorization header in the request tunneled
authorhniksic <devnull@localhost>
Fri, 28 Nov 2003 11:28:05 +0000 (03:28 -0800)
committerhniksic <devnull@localhost>
Fri, 28 Nov 2003 11:28:05 +0000 (03:28 -0800)
through proxy.

src/ChangeLog
src/http.c

index 384730bc311d63b450b8b4f4ca03bc649c5c3b38..0140bbd4b077429a145f4ae97e7eba41dc9c2abf 100644 (file)
@@ -1,3 +1,8 @@
+2003-11-28  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * http.c (gethttp): Don't include the Proxy-Authorization header
+       in the request tunneled through proxy.
+
 2003-11-28  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * http.c (gethttp): Use the CONNECT handle to establish SSL
index f6498d38df041eb5671d5113e1ec7f5434084abf..ba445c4116ba4bf87ac18e1d1d4ec49c5ce49363 100644 (file)
@@ -916,11 +916,15 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
                             + (proxyauth ? strlen (proxyauth) : 0));
          sprintf (connect, "CONNECT %s:%d HTTP/1.0\r\n%s\r\n",
                   u->host, u->port, proxyauth ? proxyauth : "");
+         /* Now that PROXYAUTH is part of the CONNECT request, zero
+            it out so we don't send proxy authorization with the
+            regular request below.  */
+         proxyauth = NULL;
+
          DEBUGP (("Writing to proxy: [%s]\n", connect));
          write_error = fd_write (sock, connect, strlen (connect), -1);
          if (write_error < 0)
            {
-             xfree_null (proxyauth);
              logprintf (LOG_VERBOSE, _("Failed writing to proxy: %s.\n"),
                         strerror (errno));
              CLOSE_INVALIDATE (sock);
@@ -930,7 +934,6 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
          head = fd_read_http_head (sock);
          if (!head)
            {
-             xfree_null (proxyauth);
              logprintf (LOG_VERBOSE, _("Failed reading proxy response: %s\n"),
                         strerror (errno));
              CLOSE_INVALIDATE (sock);
@@ -950,7 +953,6 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
          if (statcode != 200)
            {
            failed_tunnel:
-             xfree_null (proxyauth);
              logprintf (LOG_NOTQUIET, _("Proxy tunneling failed: %s"),
                         message ? message : "?");
              xfree_null (message);