diff --git a/coderd/webpush/webpush_test.go b/coderd/webpush/webpush_test.go index 8a30214d89..0a8ca17546 100644 --- a/coderd/webpush/webpush_test.go +++ b/coderd/webpush/webpush_test.go @@ -536,9 +536,7 @@ func setupPushTestWithOptions(ctx context.Context, t *testing.T, db database.Sto server := httptest.NewServer(http.HandlerFunc(handlerFunc)) t.Cleanup(server.Close) - // Use an unrestricted HTTP client for tests. The default SSRF-safe - // client rejects loopback addresses, which blocks httptest.Server. - opts = append(opts, webpush.WithHTTPClient(http.DefaultClient)) + opts = append(opts, webpush.WithHTTPClient(server.Client())) manager, err := webpush.New(ctx, &logger, db, "http://example.com", opts...) require.NoError(t, err, "Failed to create webpush manager")