diff --git a/v2/cmd/integration-test/http.go b/v2/cmd/integration-test/http.go index 0fdf9f566..6f2b6e1fc 100644 --- a/v2/cmd/integration-test/http.go +++ b/v2/cmd/integration-test/http.go @@ -586,7 +586,7 @@ func (h *httpRawUnsafeRequest) Execute(filePath string) error { ts := testutils.NewTCPServer(nil, defaultStaticPort, func(conn net.Conn) { defer conn.Close() - _, _ = conn.Write([]byte("HTTP/1.1 200 OK\r\nConnection: close\r\nContent-Length: 36\r\nContent-Type: text/plain; charset=utf-8\r\n\r\nThis is test raw-unsafe-matcher test")) + _, _ = conn.Write([]byte("HTTP/1.1 200 OK\r\nContent-Length: 36\r\nContent-Type: text/plain; charset=utf-8\r\n\r\nThis is test raw-unsafe-matcher test")) }) defer ts.Close() diff --git a/v2/pkg/protocols/http/http.go b/v2/pkg/protocols/http/http.go index 83ed88ec7..8484a0b33 100644 --- a/v2/pkg/protocols/http/http.go +++ b/v2/pkg/protocols/http/http.go @@ -237,6 +237,7 @@ func (request *Request) Compile(options *protocols.ExecuterOptions) error { NoTimeout: false, FollowRedirects: request.Redirects, CookieReuse: request.CookieReuse, + Connection: &httpclientpool.ConnectionConfiguration{}, } // If we have request level timeout, ignore http client timeouts for _, req := range request.Raw { @@ -248,7 +249,7 @@ func (request *Request) Compile(options *protocols.ExecuterOptions) error { // if the headers contain "Connection" we need to disable the automatic keep alive of the standard library if _, hasConnectionHeader := request.Headers["Connection"]; hasConnectionHeader { - connectionConfiguration.Connection = &httpclientpool.ConnectionConfiguration{DisableKeepAlive: false} + connectionConfiguration.Connection.DisableKeepAlive = true } client, err := httpclientpool.Get(options.Options, connectionConfiguration)