From a537ad12d57d10498d9b572290f6050dece06b0a Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Thu, 17 Apr 2003 09:52:10 +0000 Subject: [PATCH] * "Invalid UWOBO Server" ==> "Untrusted UWOBO Server" * Added mowgli.cs.unibo.it to the list of trusted UWOBO servers. --- helm/searchEngine/searchEngine.ml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/helm/searchEngine/searchEngine.ml b/helm/searchEngine/searchEngine.ml index 77280d77a..2da581bf7 100644 --- a/helm/searchEngine/searchEngine.ml +++ b/helm/searchEngine/searchEngine.ml @@ -23,13 +23,15 @@ * http://cs.unibo.it/helm/. *) +open Http_types ;; + let debug = true;; let debug_print s = if debug then prerr_endline s;; Http_common.debug := true;; (* Http_common.debug := true;; *) (** accepted HTTP servers for ask_uwobo method forwarding *) -let valid_servers = [ "mowgli.cs.unibo.it:58080" ; "localhost:58080" ] ;; +let valid_servers = [ "mowgli.cs.unibo.it:58080" ; "mowgli.cs.unibo.it" ; "localhost:58080" ] ;; open Printf;; @@ -156,10 +158,11 @@ let callback (req: Http_types.request) outchan = in (match page with | page when is_permitted page -> - let fname = sprintf "%s/%s" pages_dir (remove_fragment page) in + (let fname = sprintf "%s/%s" pages_dir (remove_fragment page) in + Http_daemon.send_basic_headers ~code:200 outchan; + Http_daemon.send_header "Content-Type" "text/html" outchan; + Http_daemon.send_CRLF outchan; if preprocess then begin - Http_daemon.send_basic_headers ~code:200 outchan; - Http_daemon.send_CRLF outchan; iter_file (fun line -> output_string outchan @@ -179,7 +182,7 @@ let callback (req: Http_types.request) outchan = "\n")) fname end else - Http_daemon.respond_file ~fname outchan + Http_daemon.send_file ~src:(FileSrc fname) outchan) | page -> Http_daemon.respond_forbidden ~url:page outchan)) | "/ask_uwobo" -> let url = req#param "url" in @@ -188,11 +191,12 @@ let callback (req: Http_types.request) outchan = in if List.mem server_and_port valid_servers then Http_daemon.respond + ~headers:["Content-Type", "text/html"] ~body:(Http_client.Convenience.http_get url) outchan else Http_daemon.respond - ~body:(pp_error ("Invalid UWOBO server: " ^ server_and_port)) + ~body:(pp_error ("Untrusted UWOBO server: " ^ server_and_port)) outchan | "/searchPattern" -> let term_string = req#param "term" in -- 2.39.2