]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Add HTTP/1.1 Host header
authorLars Hupel <hupel@in.tum.de>
Thu, 30 Sep 2010 00:27:36 +0000 (01:27 +0100)
committerDavid Sommerseth <dazo@users.sourceforge.net>
Fri, 12 Nov 2010 21:11:49 +0000 (22:11 +0100)
OpenVPN should send a Host: header to comply with the HTTP/1.1
specification.

Full discussion of this patch can be found here:
<http://thread.gmane.org/gmane.network.openvpn.devel/4039>

Signed-off-by: Lars Hupel <hupel@in.tum.de>
Acked-by: Peter Stuge <peter@stuge.se>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Trac-ticket: 63

proxy.c

diff --git a/proxy.c b/proxy.c
index 3de2ac1a2317aeace347ab0f53c954974845ddad..fce64a14f153243c9a73b07bdb593661c4e9b652 100644 (file)
--- a/proxy.c
+++ b/proxy.c
@@ -552,6 +552,10 @@ establish_http_proxy_passthru (struct http_proxy_info *p,
       if (!send_line_crlf (sd, buf))
        goto error;
 
+      openvpn_snprintf(buf, sizeof(buf), "Host: %s", host);
+      if (!send_line_crlf(sd, buf))
+        goto error;
+
       /* send User-Agent string if provided */
       if (p->options.user_agent)
        {