(* 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