Skip to content

Commit

Permalink
refactor: remove some weirdness
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <[email protected]>

<!-- ps-id: e40d2fc2-a99c-41de-933b-ae001526236c -->
  • Loading branch information
rgrinberg committed Jun 30, 2024
1 parent e650bcc commit 6bae672
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cohttp/src/header.ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let media_type_re =
let re = Re.Emacs.re ~case:true "[ \t]*\\([^ \t;]+\\)" in
Re.(compile (seq [ start; re ]))

let get_first_match _re s =
let get_first_match s =
try
let subs = Re.exec ~pos:0 media_type_re s in
let start, stop = Re.Group.offset subs 1 in
Expand All @@ -32,7 +32,7 @@ let get_first_match _re s =
(* Grab "foo/bar" from " foo/bar ; charset=UTF-8" *)
let get_media_type headers =
match get headers "content-type" with
| Some s -> get_first_match media_type_re s
| Some s -> get_first_match s
| None -> None

let get_acceptable_media_ranges headers =
Expand Down

0 comments on commit 6bae672

Please sign in to comment.