From 615c5740efbc23763305ec463a09a39f011757b9 Mon Sep 17 00:00:00 2001 From: Dag-Erling Smørgrav Date: Thu, 22 Aug 2013 07:43:36 +0000 Subject: Even though it doesn't really make sense in the context of a CONNECT request, RFC 2616 14.23 mandates the presence of the Host: header in all HTTP 1.1 requests. PR: kern/181445 Submitted by: Kimo MFC after: 3 days --- lib/libfetch/http.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/libfetch') diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c index 99b8030e7386..87535f001698 100644 --- a/lib/libfetch/http.c +++ b/lib/libfetch/http.c @@ -1400,6 +1400,8 @@ http_connect(struct url *URL, struct url *purl, const char *flags) if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && purl) { http_cmd(conn, "CONNECT %s:%d HTTP/1.1", URL->host, URL->port); + http_cmd(conn, "Host: %s:%d", + URL->host, URL->port); http_cmd(conn, ""); if (http_get_reply(conn) != HTTP_OK) { fetch_close(conn); -- cgit v1.3