Fix outstanding bugs
[pkg-ocaml-ocsigen.git] / extensions / ocsigen_LocalFiles.mli
blob77a981fd56864af5436b17d705d37c7ec9008f90
1 (** The requested file does not exists *)
2 exception Failed_404
3 (** The requested file cannot be served: does not exists, not
4 enough permissions ... *)
5 exception Failed_403
6 (** The file is a directory which we should not display *)
7 exception NotReadableDirectory
12 (** Default options:
13 - never follow symlinks
14 - use "index.html" as default index
15 - do not list the content of directories
17 val default_options : options
21 (** Local file corresponding to a request. The string argument
22 represents the real file or directory to serve, eg. foo/index.html
23 instead of foo *)
24 type resolved =
25 | RFile of string
26 | RDir of string
29 (** Finds [filename] in the filesystem, with a possible redirection
30 if it is a directory. Takes into account the fact that [filename]
31 does not exists, is a symlink or is a directory, and raises
32 Failed_404 or Failed_403 accordingly. [no_check_for] is supposed
33 to be a prefix of [filename] ; directories above [no_check_for]
34 are not checked for symlinks *)
35 val resolve :
36 ?no_check_for:string ->
37 request:Ocsigen_extensions.request ->
38 filename:string -> resolved
41 (** Given the local file [file], with a request originating at url
42 [url], returns a viewable content of [file]. Currently, the [url]
43 parameter is used only if [url] is a directory *)
44 val content:
45 request:Ocsigen_extensions.request -> file:resolved -> Ocsigen_http_frame.result Lwt.t