lib/http: fix race condition

This commit is contained in:
Nick Craig-Wood 2022-12-14 15:37:18 +00:00
parent a85c0b0cc2
commit 5db4493557

View file

@ -19,12 +19,9 @@ const (
func NewBaseContext(ctx context.Context, url string) func(l net.Listener) context.Context {
return func(l net.Listener) context.Context {
if l.Addr().Network() == "unix" {
ctx = context.WithValue(ctx, ctxKeyUnixSock, true)
return ctx
return context.WithValue(ctx, ctxKeyUnixSock, true)
}
ctx = context.WithValue(ctx, ctxKeyPublicURL, url)
return ctx
return context.WithValue(ctx, ctxKeyPublicURL, url)
}
}