+ (* If deleted, refuse to serve this image except if called from the
+ * deleted images page.
+ *)
+ if deleted then (
+ let referer =
+ try Table.get (Request.headers_in r) "Referer" with Not_found -> "" in
+ let ok =
+ try String.find referer "/_images?deleted"; true
+ with String.Invalid_string -> false in
+
+ if not ok then
+ failwith "image.ml: bandwidth theft avoided"
+ );
+