| "/help" -> return_help outchan
| "/getxml" ->
let uri = req#param "uri" in
- let fname = Http_getter.getxml uri in
+ let fname = Http_getter.getxml uri in (* local name, in cache *)
+ let remote_name = Http_getter.resolve uri in (* remote name *)
let src_enc = if is_gzip fname then `Gzipped else `Normal in
let enc = parse_enc req in
let fname, cleanup = convert_file ~from_enc:src_enc ~to_enc:enc fname in
let contenc = if enc = `Gzipped then Some "x-gzip" else None in
let patch_fun =
- if parse_patch req then Some (patch_fun_for uri fname) else None
+ if parse_patch req
+ then Some (patch_fun_for uri remote_name)
+ else None
in
let gunzip = (enc = `Gzipped) in
(try
| Internal_error msg ->
log_failure msg;
return_html_internal_error ("internal_error", msg) msg outchan
- | Shell.Subprocess_error l ->
- let msgs =
- List.map
- (fun (cmd, code) ->
- sprintf "Command '%s' returned %s" cmd (string_of_proc_status code))
- l
- in
- let msg = String.concat ", " msgs in
- log_failure msg;
- return_html_internal_error ("subprocess_error", msg)
- (String.concat "<br />\n" msgs) outchan
| exn ->
let msg = "uncaught exception: " ^ (Printexc.to_string exn) in
(match exn with