diff --git a/cohttp/src/header.ml b/cohttp/src/header.ml index 48cff1b24b..956f4280c5 100644 --- a/cohttp/src/header.ml +++ b/cohttp/src/header.ml @@ -50,6 +50,8 @@ let is_header_with_list_value = let init () = StringMap.empty +let is_empty x = StringMap.is_empty x + let init_with k v = StringMap.singleton (LString.of_string k) [v] diff --git a/cohttp/src/header.mli b/cohttp/src/header.mli index 612386d808..ee2f187cbc 100644 --- a/cohttp/src/header.mli +++ b/cohttp/src/header.mli @@ -22,6 +22,9 @@ type t [@@deriving sexp] (** Construct a fresh, empty map of HTTP headers *) val init : unit -> t +(** Test whether a HTTP headers are empty or not. *) +val is_empty : t -> bool + (** Construct a fresh map of HTTP headers with a single key and value entry *) val init_with : string -> string -> t