From 000f9237fc76202a03c0f5722b7ee766642a28a2 Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Thu, 6 Mar 2003 22:46:17 +0000 Subject: provide Host: in http requests so that install works from sites with virtual hosting (#2561) --- mdk-stage1/url.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mdk-stage1/url.c') diff --git a/mdk-stage1/url.c b/mdk-stage1/url.c index ada5696cd..07af07161 100644 --- a/mdk-stage1/url.c +++ b/mdk-stage1/url.c @@ -423,8 +423,8 @@ int http_download_file(char * hostname, char * remotename, int * size) return FTPERR_FAILED_CONNECT; } - buf = alloca(strlen(remotename) + 20); - sprintf(buf, "GET %s HTTP/0.9\r\n\r\n", remotename); + buf = alloca(4 + strlen(remotename) + 12 + 6 + strlen(hostname) + 4 + 1); + sprintf(buf, "GET %s HTTP/0.9\r\nHost: %s\r\n\r\n", remotename, hostname); write(sock, buf, strlen(buf)); /* This is fun; read the response a character at a time until we: -- cgit v1.2.1