@@ -205,6 +205,8 @@ val make_mime : ?charset:string -> string -> mime
205205 [charset]. Charset defaults to [utf-8] if mime type begins with
206206 [text/].
207207
208+ @raise Invalid_argument if [mime] is an empty string
209+
208210 @see < https://www.rfc-editor.org/rfc/rfc2046#section-4.1.2 >
209211 For a description of the "charset" parameter. *)
210212
@@ -220,9 +222,6 @@ val from_content : ?charset:string -> tree:Conan.Tree.t -> string -> mime option
220222 performing a mime lookup based on content [c]. [tree] is the tree used to
221223 build the MIME database. *)
222224
223- val no_mime : mime
224- (* * Represents the absence of a mime. This is a shortcut for [make_mime ""]. *)
225-
226225val gemini : ?charset : string -> ?lang : string list -> unit -> mime
227226(* * [gemini ?charset ?lang ()] is [text/gemini; charset=...; lang=...].
228227
@@ -373,8 +372,8 @@ module type FS = sig
373372 (* * Same as {!val:Mehari.response} but respond with content of given
374373 [filename] and use given {!type:Mehari.mime} as mime type.
375374 If [filename] is not present on filesystem, responds with
376- {!val:Mehari.not_found}. If [mime] parameter is not supplied, use
377- {!val:Mehari.no_mime} as mime type . *)
375+ {!val:Mehari.not_found}. If [mime] parameter is not supplied, document is
376+ served as {!val:Mehari.app_octet_stream} . *)
378377
379378 val static :
380379 ?handler : (dir_path -> handler ) ->
@@ -399,6 +398,9 @@ module type FS = sig
399398 will be generated by calling [dir_listing [ filename; ... ] request].
400399 [index] is default on [index.gmi].
401400
401+ Mime type of the served ressource is guessed by checking file name.
402+ Note that file names of the form [*.gmi] will be served as [text/gemini].
403+
402404 [show_hidden] decides whether hidden files should be listed. It defaults to
403405 [false] for security reasons. *)
404406end
0 commit comments