From 695d45147ac5e1f6a65f94094759db437d6928c2 Mon Sep 17 00:00:00 2001 From: acerone85 Date: Sat, 4 May 2024 23:07:56 +0100 Subject: [PATCH] Grpc-lwt: fetch status code from response header --- lib/grpc-lwt/client.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/grpc-lwt/client.ml b/lib/grpc-lwt/client.ml index db2cf6f..886dc98 100644 --- a/lib/grpc-lwt/client.ml +++ b/lib/grpc-lwt/client.ml @@ -44,8 +44,8 @@ let call ~service ~rpc ?(scheme = "https") ~handler ~(do_request : do_request) match response.status with | `OK -> let+ status = - match H2.Headers.get headers "grpc-status" with - | Some _ -> Lwt.return (Grpc.Status.extract_status headers) + match H2.Headers.get response.headers "grpc-status" with + | Some _ -> Lwt.return (Grpc.Status.extract_status response.headers) | None -> status in Ok (handler_res, status)