From: Stefano Zacchiroli Date: Thu, 26 Dec 2002 15:52:03 +0000 (+0000) Subject: - added support for 'patch_dtd' parameter in 'respond_dtd' X-Git-Tag: v0_3_99~115 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=853195c8cae7b029f3e500a5b712a67cf4467e84;p=helm.git - added support for 'patch_dtd' parameter in 'respond_dtd' - changed content-type of 'respond_dtd' to text/plain --- diff --git a/helm/http_getter/http_getter_cache.ml b/helm/http_getter/http_getter_cache.ml index 6d2fe6e06..7d6584c99 100644 --- a/helm/http_getter/http_getter_cache.ml +++ b/helm/http_getter/http_getter_cache.ml @@ -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