From 87b9b24c7617b1fc369ad97b49a52352050ac76d Mon Sep 17 00:00:00 2001 From: Andreas Garnaes Date: Thu, 28 Mar 2019 13:54:12 +0100 Subject: [PATCH] graphql-cohttp: fix routing --- graphql-cohttp/src/graphql_cohttp.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphql-cohttp/src/graphql_cohttp.ml b/graphql-cohttp/src/graphql_cohttp.ml index c99ceec..59c3d12 100644 --- a/graphql-cohttp/src/graphql_cohttp.ml +++ b/graphql-cohttp/src/graphql_cohttp.ml @@ -99,7 +99,7 @@ module Make let make_callback : (Cohttp.Request.t -> 'ctx) -> 'ctx Schema.schema -> 'conn callback = fun make_context schema _conn (req : Cohttp.Request.t) body -> let req_path = Cohttp.Request.uri req |> Uri.path in - let path_parts = Astring.String.cuts ~sep:"/" req_path in + let path_parts = Astring.String.cuts ~empty:false ~sep:"/" req_path in match req.meth, path_parts with | `GET, ["graphql"] -> if Cohttp.Header.get req.Cohttp.Request.headers "Connection" = Some "Upgrade" && Cohttp.Header.get req.headers "Upgrade" = Some "websocket" then