File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -311,9 +311,11 @@ let find_map f l =
311311 in
312312 aux f l
313313
314- let string_as_list_contains_ (s : string ) (sub : string ) : bool =
314+ let header_list_contains_ (s : string ) (name : string ) : bool =
315+ let name' = String. lowercase_ascii name in
315316 let fragments = String. split_on_char ',' s in
316- List. exists (fun fragment -> String. trim fragment = sub) fragments
317+ List. exists (fun fragment ->
318+ String. lowercase_ascii (String. trim fragment) = name') fragments
317319
318320(* handle client on [ic] and [oc] *)
319321let client_handle_for (self : t ) ~client_addr ic oc : unit =
@@ -379,7 +381,7 @@ let client_handle_for (self : t) ~client_addr ic oc : unit =
379381
380382 (* check headers *)
381383 (match Request. get_header req " connection" with
382- | Some str when string_as_list_contains_ str " Upgrade" -> ()
384+ | Some str when header_list_contains_ str " Upgrade" -> ()
383385 | _ -> bad_reqf 426 " connection header must contain 'Upgrade'" );
384386 (match Request. get_header req " upgrade" with
385387 | Some u when u = UP. name -> ()
You can’t perform that action at this time.
0 commit comments