mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 03:05:29 -05:00
add Head_middleware.trivial
This commit is contained in:
parent
e1368525d8
commit
241d9aeaf1
2 changed files with 6 additions and 1 deletions
|
|
@ -12,6 +12,7 @@ end
|
|||
module Head_middleware = struct
|
||||
type t = { handle: 'a. 'a Request.t -> 'a Request.t }
|
||||
|
||||
let trivial = { handle = Fun.id }
|
||||
let[@inline] apply (self : t) req = self.handle req
|
||||
let[@inline] apply' req (self : t) = self.handle req
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,11 @@ end
|
|||
module Head_middleware : sig
|
||||
type t = { handle: 'a. 'a Request.t -> 'a Request.t }
|
||||
(** A handler that takes the request, without its body,
|
||||
and possibly modifies it. *)
|
||||
and possibly modifies it.
|
||||
@since NEXT_RELEASE *)
|
||||
|
||||
val trivial : t
|
||||
(** Pass through *)
|
||||
|
||||
val to_middleware : t -> Middleware.t
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue