(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: image.ml,v 1.10 2004/10/24 08:48:38 rich Exp $
+ * $Id: image.ml,v 1.12 2004/10/28 14:51:03 rich Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
sth#execute args;
let data, mime_type, deleted =
- match sth#fetch1 () with
- [ `Binary data; `String mime_type; `Bool deleted ] ->
- data, mime_type, deleted
- | _ -> assert false in
+ try
+ (match sth#fetch1 () with
+ [ `Binary data; `String mime_type; `Bool deleted ] ->
+ data, mime_type, deleted
+ | _ -> assert false)
+ with
+ Not_found -> raise (HttpError cHTTP_NOT_FOUND) in
(* If deleted, refuse to serve this image except if called from the
* deleted images page.
)
);
- if version <> None then
- (* Set a medium-length expiry time on this resource. *)
- Table.set (Request.headers_out r) "Expires" (Expires.medium ());
+ (* Set a medium-length expiry time on this resource. *)
+ Table.set (Request.headers_out r) "Expires" (Expires.medium ());
(* Content-length header. *)
Table.set (Request.headers_out r) "Content-Length"