Skip to content

Commit

Permalink
[~] fix close body
Browse files Browse the repository at this point in the history
  • Loading branch information
Noooste committed Feb 10, 2024
1 parent fe70806 commit 30f1f4e
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 16 deletions.
4 changes: 2 additions & 2 deletions response.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ func (s *Session) buildResponse(response *Response, httpResponse *http.Response)
headers = make(http.Header, len(httpResponse.Header))
)

wg.Add(1)

if !response.IgnoreBody {
wg.Add(1)

go func() {
done := make(chan bool, 1)

Expand Down
4 changes: 0 additions & 4 deletions test/compression_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
)

func TestDecompressBody_Gzip(t *testing.T) {
t.Parallel()

session := azuretls.NewSession()

session.OrderedHeaders = azuretls.OrderedHeaders{
Expand Down Expand Up @@ -45,8 +43,6 @@ func tTestDecompressBody_Deflate(t *testing.T) {
}

func TestDecompressBody_Brotli(t *testing.T) {
t.Parallel()

session := azuretls.NewSession()

session.OrderedHeaders = azuretls.OrderedHeaders{
Expand Down
4 changes: 0 additions & 4 deletions test/connection_proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ func TestProxyDialer(t *testing.T) {
}

func TestProxy(t *testing.T) {
t.Parallel()

session := azuretls.NewSession()

if err := session.SetProxy(""); err == nil {
Expand Down Expand Up @@ -197,8 +195,6 @@ func TestProxy4(t *testing.T) {
}

func TestBadProxy(t *testing.T) {
t.Parallel()

session := azuretls.NewSession()
session.SetTimeout(1 * time.Second)
defer session.Close()
Expand Down
6 changes: 0 additions & 6 deletions test/connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
)

func TestSessionConn(t *testing.T) {
t.Parallel()

runtime.GOMAXPROCS(runtime.NumCPU())

session := azuretls.NewSession()
Expand Down Expand Up @@ -56,8 +54,6 @@ func TestSessionConn(t *testing.T) {
}

func TestHTTP1Conn(t *testing.T) {
t.Parallel()

session := azuretls.NewSession()

_, err := session.Get("https://api.ipify.org/")
Expand All @@ -82,8 +78,6 @@ func TestCloudflareRequest(t *testing.T) {
}

func TestHighConcurrency(t *testing.T) {
t.Parallel()

session := azuretls.NewSession()

wait := &sync.WaitGroup{}
Expand Down

0 comments on commit 30f1f4e

Please sign in to comment.