]> matita.cs.unibo.it Git - helm.git/commitdiff
- added support for 'patch_dtd' parameter in 'respond_dtd'
authorStefano Zacchiroli <zack@upsilon.cc>
Thu, 26 Dec 2002 15:52:03 +0000 (15:52 +0000)
committerStefano Zacchiroli <zack@upsilon.cc>
Thu, 26 Dec 2002 15:52:03 +0000 (15:52 +0000)
- changed content-type of 'respond_dtd' to text/plain

helm/http_getter/http_getter_cache.ml

index 6d2fe6e06fa52ed4480c6354492e6731acec8560..7d6584c9975338bf482859fd437fdedb1645a26d 100644 (file)
@@ -109,10 +109,12 @@ let respond_xsl ?(enc = Enc_normal) ?(patch_dtd = true) ~url outchan =
 
   (* TODO patch_dtd and format are fooish, implement them! *)
 let respond_dtd ?(enc = Enc_normal) ?(patch_dtd = true) ~url outchan =
-    if Sys.file_exists url then
-      return_file
-        ~fname:url ~contype:"text/xml" ~patch_fun:Http_getter_common.patch_dtd
-        outchan
-    else
-      return_html_error ("Can't find DTD: " ^ url) outchan
+  let patch_fun =
+    if patch_dtd then Http_getter_common.patch_dtd else (fun x -> x)
+  in
+  if Sys.file_exists url then
+    (* TODO check this: old getter here use text/xml *)
+    return_file ~fname:url ~contype:"text/plain" ~patch_fun outchan
+  else
+    return_html_error ("Can't find DTD: " ^ url) outchan