Skip to content

Commit 748f259

Browse files
committed
Add the convenience function Header.is_empty
1 parent 4010f2a commit 748f259

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

cohttp/src/header.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ let is_header_with_list_value =
5050
let init () =
5151
StringMap.empty
5252

53+
let is_empty x = StringMap.is_empty x
54+
5355
let init_with k v =
5456
StringMap.singleton (LString.of_string k) [v]
5557

cohttp/src/header.mli

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ type t [@@deriving sexp]
2222
(** Construct a fresh, empty map of HTTP headers *)
2323
val init : unit -> t
2424

25+
(** Test whether a map is empty or not. *)
26+
val is_empty : t -> unit
27+
2528
(** Construct a fresh map of HTTP headers with a single key and value entry *)
2629
val init_with : string -> string -> t
2730

0 commit comments

Comments
 (0)