diff --git a/url.c b/url.c index 3b1328d..914041f 100644 --- a/url.c +++ b/url.c @@ -424,8 +424,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/1.0\r\n\r\n", remotename); + buf = alloca(strlen(remotename) + strlen(hostname) + 20); + sprintf(buf, "GET %s HTTP/1.1\r\nHost: %s\r\n\r\n", remotename, hostname); rc = write(sock, buf, strlen(buf)); /* This is fun; read the response a character at a time until we: