From 7cb16ef98237cb4c0baf0e8cf25eaff7b21a1851 Mon Sep 17 00:00:00 2001 From: Silvan Date: Thu, 11 Jul 2024 15:22:01 +0200 Subject: [PATCH] fix(api): grpc content type matcher all grpc types (#8285) # Which Problems Are Solved ZITADEL returned a 404 Unimplemented error if the client sent 'application/grpc+proto' or 'application/grpc+json' which are both valid content types. # How the Problems Are Solved changed the header matcher to regexp # Additional Context Problem occured in https://github.com/zitadel/typescript/tree/grpc-transport (cherry picked from commit aa273ad00042c34ec87c25ed63ec3a03cb68984e) --- internal/api/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/api.go b/internal/api/api.go index 2b94e1e284..6695403e46 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -180,7 +180,7 @@ func (a *API) RouteGRPC() { Name("grpc") http2Route. Methods(http.MethodPost). - Headers("Content-Type", "application/grpc"). + HeadersRegexp(http_util.ContentType, `application\/grpc(\+proto|\+json)?`). Handler(a.grpcServer) a.routeGRPCWeb()