ServeHTTP in server is not using Request context
HRogge opened this issue · comments
Henning Rogge commented
The ServeHTTP() function in server.go does create its own context based on context.Background(). Is there a special reason not to use r.Context() ? Using the http.Request context (which is normally context.Background()) should make it easier to handle situations with http based context interruptions.
Douglas Hubler commented
That's a great idea, no good reason it doesn't do that. Will you be
submitting MR or do you want me to look into it?
…On Tue, May 9, 2023, 5:00 AM Henning Rogge ***@***.***> wrote:
The ServeHTTP() function in server.go does create its own context based on
context.Background(). Is there a special reason not to use r.Context() ?
Using the http.Request context (which is normally context.Background())
should make it easier to handle situations with http based context
interruptions.
—
Reply to this email directly, view it on GitHub
<#34>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAACA7SIUBQA4Y5DKVGCJYDXFIBSZANCNFSM6AAAAAAX27J364>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
Henning Rogge commented
I can see if I can work on it tomorrow... it came up while I added the new constructor for "no internal HTTP server"