From f0334aed1b3f2531797fd3a45d48ddbbc8b5ee99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandor=20Sz=C3=BCcs?= Date: Fri, 11 Aug 2023 22:53:09 +0200 Subject: [PATCH] fix: http client can sometimes create more than one request, so use RoundTrip and transport to do the request 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) }