-let return_all_xml_uris outchan =
- return_all_foo_uris "alluris" (Http_getter.getalluris ()) outchan
+let return_all_xml_uris fmt outchan =
+ let uris = Http_getter.getalluris () in
+ match fmt with
+ | Fmt_text ->
+ let buf = Buffer.create 10240 in
+ List.iter (bprintf buf "%s\n") uris ;
+ let body = Buffer.contents buf in
+ Http_daemon.respond
+ ~headers:(("Content-Type", "text/plain") :: common_headers)
+ ~body outchan
+ | Fmt_xml ->
+ return_all_foo_uris "alluris" uris outchan
+