Use process context as base context for all HTTP

This commit is contained in:
Neil Alexander 2022-04-27 15:01:57 +01:00
parent 655ac3e8fb
commit cafa2853c5
No known key found for this signature in database
GPG Key ID: A02A2019A2BB0944

View File

@ -346,6 +346,9 @@ func (b *BaseDendrite) SetupAndServeHTTP(
Addr: string(externalAddr), Addr: string(externalAddr),
WriteTimeout: HTTPServerTimeout, WriteTimeout: HTTPServerTimeout,
Handler: externalRouter, Handler: externalRouter,
BaseContext: func(_ net.Listener) context.Context {
return b.ProcessContext.Context()
},
} }
internalServ := externalServ internalServ := externalServ
@ -361,6 +364,9 @@ func (b *BaseDendrite) SetupAndServeHTTP(
internalServ = &http.Server{ internalServ = &http.Server{
Addr: string(internalAddr), Addr: string(internalAddr),
Handler: h2c.NewHandler(internalRouter, internalH2S), Handler: h2c.NewHandler(internalRouter, internalH2S),
BaseContext: func(_ net.Listener) context.Context {
return b.ProcessContext.Context()
},
} }
} }