From 1fe9e592b22274b7ab6bbbab8e29135993523c1c Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Thu, 1 Apr 2004 16:59:09 +0000 Subject: [PATCH] - added "Host:" line to http requests so that virtual hosting hosts are supported (and ancient HTTP are no longer supported) --- helm/DEVEL/ocaml-http/http_client.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helm/DEVEL/ocaml-http/http_client.ml b/helm/DEVEL/ocaml-http/http_client.ml index 94f60f688..f903add7a 100644 --- a/helm/DEVEL/ocaml-http/http_client.ml +++ b/helm/DEVEL/ocaml-http/http_client.ml @@ -56,7 +56,9 @@ let http_get_iter callback url = let (address, port, path) = parse_url url in let buf = String.create tcp_bufsiz in let (inchan, outchan) = init_socket address port in - output_string outchan (sprintf "GET %s HTTP/1.0\r\n\r\n" path); + output_string outchan (sprintf "GET %s HTTP/1.0\r\n" path); + output_string outchan (sprintf "Host: %s\r\n\r\n" address); + flush outchan; let (_, status) = Http_parser.parse_response_fst_line inchan in (match code_of_status status with -- 2.39.2