]> matita.cs.unibo.it Git - helm.git/commitdiff
- added "Host:" line to http requests so that virtual hosting hosts are
authorStefano Zacchiroli <zack@upsilon.cc>
Thu, 1 Apr 2004 16:59:09 +0000 (16:59 +0000)
committerStefano Zacchiroli <zack@upsilon.cc>
Thu, 1 Apr 2004 16:59:09 +0000 (16:59 +0000)
  supported (and ancient HTTP are no longer supported)

helm/DEVEL/ocaml-http/http_client.ml

index 94f60f68810074bff27b4e612a1fed48f840812e..f903add7a51ad3333ef77a756ab3571be68206ac 100644 (file)
@@ -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