From bd437c1c17cef321f5b5e52bdd0045d7f5b6bc0e Mon Sep 17 00:00:00 2001 From: Klaus Post Date: Thu, 16 Apr 2020 20:54:12 +0200 Subject: [PATCH] set server base context on gateway http server (#9365) --- cmd/gateway-main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/gateway-main.go b/cmd/gateway-main.go index eef19f7e0..50d3b144d 100644 --- a/cmd/gateway-main.go +++ b/cmd/gateway-main.go @@ -17,7 +17,9 @@ package cmd import ( + "context" "fmt" + "net" "net/url" "os" "os/signal" @@ -196,6 +198,9 @@ func StartGateway(ctx *cli.Context, gw Gateway) { httpServer := xhttp.NewServer([]string{globalCLIContext.Addr}, criticalErrorHandler{registerHandlers(router, globalHandlers...)}, getCert) + httpServer.BaseContext = func(listener net.Listener) context.Context { + return GlobalContext + } go func() { globalHTTPServerErrorCh <- httpServer.Start() }()