From 75f1d3e7d75f67c9b46408b46d10d16d4236dc1a Mon Sep 17 00:00:00 2001 From: Irbe Krumina Date: Tue, 23 Jan 2024 19:02:07 +0000 Subject: [PATCH] ipn/ipnlocal: fix failing test (#10937) Updates#cleanup Signed-off-by: Irbe Krumina --- ipn/ipnlocal/serve_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ipn/ipnlocal/serve_test.go b/ipn/ipnlocal/serve_test.go index 604cf0b3a..4eeb882e8 100644 --- a/ipn/ipnlocal/serve_test.go +++ b/ipn/ipnlocal/serve_test.go @@ -433,10 +433,11 @@ func TestServeHTTPProxyPath(t *testing.T) { URL: &url.URL{Path: tt.requestPath}, TLS: &tls.ConnectionState{ServerName: "example.ts.net"}, } - req = req.WithContext(context.WithValue(req.Context(), serveHTTPContextKey{}, &serveHTTPContext{ - DestPort: 443, - SrcAddr: netip.MustParseAddrPort("1.2.3.4:1234"), // random src - })) + req = req.WithContext(serveHTTPContextKey.WithValue(req.Context(), + &serveHTTPContext{ + DestPort: 443, + SrcAddr: netip.MustParseAddrPort("1.2.3.4:1234"), // random src + })) w := httptest.NewRecorder() b.serveWebHandler(w, req)