File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -917,17 +917,18 @@ module Make(IO:IO)(Clock:CLOCK) = struct
917917
918918 let dispatch table =
919919 let table =
920- List. map (fun (p , t , mk_resource ) ->
921- (p, t, fun path_info dispatch_path ~body ~request ->
922- let resource = mk_resource () in
923- to_handler ?dispatch_path ~path_info ~resource ~body ~request () ))
924- table
920+ Dispatch. create
921+ (List. map (fun (p , t , mk_resource ) ->
922+ (p, t, fun path_info dispatch_path ~body ~request ->
923+ let resource = mk_resource () in
924+ to_handler ?dispatch_path ~path_info ~resource ~body ~request () ))
925+ table)
925926 in
926927 fun ~body ~request ->
927928 let path = Uri. path (Cohttp.Request. uri request) in
928929 match Dispatch. dispatch table path with
929- | Result. Error _ -> return None
930- | Result. Ok handler -> handler ~body ~request >> = fun x -> return (Some x)
930+ | None -> return None
931+ | Some handler -> handler ~body ~request >> = fun x -> return (Some x)
931932
932933 let dispatch' table =
933934 dispatch (List. map (fun (m , r ) ->
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ depends: [
1414 "ocaml" {>= "4.03.0"}
1515 "ptime" {>= "0.8.0"}
1616 "cohttp" {>= "1.0.0"}
17- "dispatch" {>= "0.3.0" & < "0. 5.0"}
17+ "dispatch" {>= "0.5.0"}
1818 "dune" {>= "1.0"}
1919 "ounit" {with-test & >= "1.0.2"}
2020 "re" {>= "1.7.2"}
You can’t perform that action at this time.
0 commit comments