let page = remove_fragment (req#param "url") in
match page with
| page when is_permitted page ->
- let fname = sprintf "%s/%s" pages_dir (remove_fragment page) in
- debug_print (sprintf "Returning file: %s" fname);
- Http_daemon.send_basic_headers ~code:200 outchan;
- Http_daemon.send_CRLF outchan;
- Http_daemon.send_file ~name:fname outchan
+ Http_daemon.respond_file
+ ~fname:(sprintf "%s/%s" pages_dir (remove_fragment page)) outchan
| page -> Http_daemon.respond_forbidden ~url:page outchan)
| "/searchPattern" ->
let term_string = req#param "term" in