diff --git a/cohttp.opam b/cohttp.opam index 85d3c7d8bd..371d3d0f50 100644 --- a/cohttp.opam +++ b/cohttp.opam @@ -34,7 +34,7 @@ bug-reports: "https://github.com/mirage/ocaml-cohttp/issues" depends: [ "ocaml" {>= "4.04.1"} "dune" {build & >= "1.1.0"} - "re" {>= "1.7.2"} + "re" {>= "1.9.0"} "uri" {>= "2.0.0"} "fieldslib" "sexplib0" diff --git a/cohttp/src/header.ml b/cohttp/src/header.ml index 3e20ec6542..843d160d68 100644 --- a/cohttp/src/header.ml +++ b/cohttp/src/header.ml @@ -173,7 +173,7 @@ let media_type_re = let get_first_match _re s = try let subs = Re.exec ~pos:0 media_type_re s in - let (start, stop) = Re.get_ofs subs 1 in + let (start, stop) = Re.Group.offset subs 1 in Some (String.sub s start (stop - start)) with Not_found -> None