]> sjero.net Git - wget/commitdiff
http: specify Host when CONNECT is used.
authorPavel Mateja <pavel@netsafe.cz>
Sat, 2 Nov 2013 10:27:58 +0000 (11:27 +0100)
committerGiuseppe Scrivano <gscrivan@redhat.com>
Sat, 2 Nov 2013 10:30:04 +0000 (11:30 +0100)
src/ChangeLog
src/http.c

index 73ae4ee9d7de2e6a8dec5cca5630273862cc35ba..68e0f86773f62fdf9db320bb95cace0c535b4fa2 100644 (file)
@@ -1,3 +1,7 @@
+2013-01-30  Pavel Mateja  <pavel@netsafe.cz> (tiny change)
+
+       * http.c (gethttp): Specify "Host" for CONNECT method.
+
 2013-10-30  Giuseppe Scrivano  <gscrivan@redhat.com>
 
        * http.c (skip_short_body): Remove assert which is always true.
index dbfcdfbf407acfba5a5c7a32600e96e1d3ea2a66..8917fa558bd2f9183222858681d9b3d92c73529b 100644 (file)
@@ -2013,10 +2013,9 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy,
                  the regular request below.  */
               proxyauth = NULL;
             }
-          /* Examples in rfc2817 use the Host header in CONNECT
-             requests.  I don't see how that gains anything, given
-             that the contents of Host would be exactly the same as
-             the contents of CONNECT.  */
+          request_set_header (connreq, "Host",
+                              aprintf ("%s:%d", u->host, u->port),
+                              rel_value);
 
           write_error = request_send (connreq, sock, 0);
           request_free (connreq);