Skip to content

Commit

Permalink
fix: http client can sometimes create more than one request, so use R…
Browse files Browse the repository at this point in the history
…oundTrip and transport to do the request (#2513)

Signed-off-by: Sandor Szücs <[email protected]>
  • Loading branch information
szuecs authored Aug 14, 2023
1 parent 0ee30aa commit c0bbaae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion filters/tee/tee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit c0bbaae

Please sign in to comment.