set server base context on gateway http server (#9365)

master
Klaus Post 5 years ago committed by GitHub
parent 69fb68ef0b
commit bd437c1c17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      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()
}()

Loading…
Cancel
Save