From c0bbaae53cfe04d2c7e8a130837790fbf722f857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandor=20Sz=C3=BCcs?= Date: Mon, 14 Aug 2023 17:23:24 +0200 Subject: [PATCH] fix: http client can sometimes create more than one request, so use RoundTrip and transport to do the request (#2513) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sandor Szücs --- filters/tee/tee_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/filters/tee/tee_test.go b/filters/tee/tee_test.go index 7d3cd2eade..fb3364306f 100644 --- a/filters/tee/tee_test.go +++ b/filters/tee/tee_test.go @@ -12,6 +12,7 @@ import ( "github.com/zalando/skipper/eskip" "github.com/zalando/skipper/filters" "github.com/zalando/skipper/filters/filtertest" + "github.com/zalando/skipper/net" "github.com/zalando/skipper/proxy/proxytest" "github.com/zalando/skipper/routing" "github.com/zalando/skipper/routing/testdataclient" @@ -255,7 +256,9 @@ func TestTeeEndToEndBody2TeeRoutesAndClosing(t *testing.T) { req.Host = "www.example.org" req.Close = true - rsp, err := (&http.Client{}).Do(req) + rt := net.NewTransport(net.Options{}) + defer rt.Close() + rsp, err := rt.RoundTrip(req) if err != nil { t.Error(err) }