Skip to content

Commit a5fff1d

Browse files
authored
Merge pull request #83 from andrewalker/andrewalker/accept-exceptions
accept: Don't crash on parsing errors
2 parents 6f10ad7 + 9087c3d commit a5fff1d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/wm_util.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ module MediaType = struct
103103
| MediaType (type_', subtype') -> type_' = type_ && subtype' = subtype
104104

105105
let match_header provided header =
106-
let ranges = Accept.(media_ranges header |> qsort) in
106+
let ranges = try Accept.(media_ranges header |> qsort) with Parsing.Parse_error -> [] in
107107
let rec loop = function
108108
| [] -> None
109109
| r::rs -> try Some(List.find (media_match r) provided) with Not_found -> loop rs

0 commit comments

Comments
 (0)