From 79538d65a060641788bae111438edb705119a4cd Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Thu, 18 Sep 2003 15:41:11 +0000 Subject: [PATCH] prop.media-type and prop.encoding were _NOT_ considered when the corresponding HTML was generated. Fixed. --- helm/uwobo/uwobo.ml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/helm/uwobo/uwobo.ml b/helm/uwobo/uwobo.ml index 0a0294c41..5d67eacfa 100644 --- a/helm/uwobo/uwobo.ml +++ b/helm/uwobo/uwobo.ml @@ -44,6 +44,21 @@ let port_env_var = "UWOBO_PORT" ;; let log_env_var = "UWOBO_LOG_FILE" ;; (* The extension _pid.log will be added *) let default_media_type = "text/html" ;; let default_encoding = "utf8" ;; + +let get_media_type props = + try + List.assoc "media-type" props + with + Not_found -> default_media_type +;; + +let get_encoding props = + try + List.assoc "encoding" props + with + Not_found -> default_encoding +;; + let port = try int_of_string (Sys.getenv port_env_var) @@ -353,8 +368,8 @@ let callback in let content_type = (* value of Content-Type HTTP response header *) sprintf "%s; charset=%s" - (match media_type with None -> default_media_type | Some t -> t) - (match encoding with None -> default_encoding | Some e -> e) + (match media_type with None -> get_media_type props | Some t -> t) + (match encoding with None -> get_encoding props | Some e -> e) in syslogger#log `Debug (sprintf "sending output to client (Content-Type: %s)...." -- 2.39.2