From cafa2853c5d67b3dd4d247abdd1ad5806f0c951b Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Wed, 27 Apr 2022 15:01:57 +0100 Subject: [PATCH] Use process context as base context for all HTTP --- setup/base/base.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup/base/base.go b/setup/base/base.go index dbc5d239..51c43198 100644 --- a/setup/base/base.go +++ b/setup/base/base.go @@ -346,6 +346,9 @@ func (b *BaseDendrite) SetupAndServeHTTP( Addr: string(externalAddr), WriteTimeout: HTTPServerTimeout, Handler: externalRouter, + BaseContext: func(_ net.Listener) context.Context { + return b.ProcessContext.Context() + }, } internalServ := externalServ @@ -361,6 +364,9 @@ func (b *BaseDendrite) SetupAndServeHTTP( internalServ = &http.Server{ Addr: string(internalAddr), Handler: h2c.NewHandler(internalRouter, internalH2S), + BaseContext: func(_ net.Listener) context.Context { + return b.ProcessContext.Context() + }, } }