From 9a1438d2e3916a5fde656e145f32536118338d44 Mon Sep 17 00:00:00 2001 From: Juan Font Alonso Date: Sun, 4 Sep 2022 11:35:13 +0200 Subject: [PATCH] Use inherited context --- derp_server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/derp_server.go b/derp_server.go index b965015..6fe897b 100644 --- a/derp_server.go +++ b/derp_server.go @@ -154,7 +154,7 @@ func (h *Headscale) DERPHandler( if !fastStart { pubKey := h.privateKey.Public() - pubKeyStr := pubKey.UntypedHexString() // nolint + pubKeyStr := pubKey.UntypedHexString() //nolint fmt.Fprintf(conn, "HTTP/1.1 101 Switching Protocols\r\n"+ "Upgrade: DERP\r\n"+ "Connection: Upgrade\r\n"+ @@ -202,7 +202,7 @@ func (h *Headscale) DERPBootstrapDNSHandler( ) { dnsEntries := make(map[string][]net.IP) - resolvCtx, cancel := context.WithTimeout(context.Background(), time.Minute) + resolvCtx, cancel := context.WithTimeout(req.Context(), time.Minute) defer cancel() var resolver net.Resolver for _, region := range h.DERPMap.Regions {