From feb80f6d4213cd1ad6e4dd10f4fbc2bd9fcada50 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Sat, 17 Jul 2021 12:02:04 +0200 Subject: [PATCH] grpcweb: remove useless HTTP HandlerFun wrapping --- server/grpc/grpc_web.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/server/grpc/grpc_web.go b/server/grpc/grpc_web.go index 593779835a78..aa4575b9c902 100644 --- a/server/grpc/grpc_web.go +++ b/server/grpc/grpc_web.go @@ -21,12 +21,9 @@ func StartGRPCWeb(grpcSrv *grpc.Server, config config.Config) (*http.Server, err } wrappedServer := grpcweb.WrapServer(grpcSrv, options...) - handler := func(resp http.ResponseWriter, req *http.Request) { - wrappedServer.ServeHTTP(resp, req) - } grpcWebSrv := &http.Server{ Addr: config.GRPCWeb.Address, - Handler: http.HandlerFunc(handler), + Handler: wrappedServer, } if err := grpcWebSrv.ListenAndServe(); err != nil { return nil, err