summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-03-06 22:46:17 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-03-06 22:46:17 +0000
commit000f9237fc76202a03c0f5722b7ee766642a28a2 (patch)
treebb315c96afb49dcf0255889cd92e478b44d4d5ac
parent7bc018c9230f830f48d07cc8d70c33ed5c60d958 (diff)
downloaddrakx-000f9237fc76202a03c0f5722b7ee766642a28a2.tar
drakx-000f9237fc76202a03c0f5722b7ee766642a28a2.tar.gz
drakx-000f9237fc76202a03c0f5722b7ee766642a28a2.tar.bz2
drakx-000f9237fc76202a03c0f5722b7ee766642a28a2.tar.xz
drakx-000f9237fc76202a03c0f5722b7ee766642a28a2.zip
provide Host: in http requests so that install works from sites with virtual hosting (#2561)
-rw-r--r--mdk-stage1/url.c4
1 files changed, 2 insertions, 2 deletions
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: