package mehari
Install
Dune Dependency
Authors
Maintainers
Sources
md5=f06e131a181383bc4e2515c4cd049b04
sha512=43abbfd3d30be29dc814207152474877356e74877867b2f3bf7be93c4c551c4fed4b915fe60b6bf9bd03e6605bd3fdf1ce31af750267470df04906a75b93693f
doc/mehari/Mehari/module-type-UNIX/index.html
Module type Mehari.UNIX
Source
Module type containing all UNIX-dependent functions.
Static files
Same as Mehari.response
but respond with content of given filename
and use given Mehari.mime
as mime type. If filename
is not present on filesystem, responds with Mehari.not_found
. If mime
parameter is not supplied, use Mehari.no_mime
as mime type.
val static :
?handler:(dir_path -> handler) ->
?dir_listing:
(([ `Regular_file | `Directory | `Other ] * string) list -> handler) ->
?index:string ->
?show_hidden:bool ->
dir_path ->
handler
static dir
validates the path parameter (retrieved by calling Mehari.param req 1
) by checking that it is relative and does not contain parent directory references. If these checks fail, responds with Mehari.not_found
.
If the checks succeed, static
calls handler path request
, where path
is the path generated by the concatenation of directory that was passed to static
and path of request. handler
defaults to response_document
.
If a directory is requested, static
will look for a file named index
in that directory to return. Otherwise, a directory file listing will be generated by calling dir_listing [ filename; ... ] request
. index
is default on index.gmi
.
show_hidden
decides whether hidden files should be listed. It defaults to false
for security reasons.