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