Skip to content

Commit

Permalink
fix idle pconn fatal error (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
jensneuse committed Feb 19, 2021
1 parent 71fb8f0 commit 6c3e11b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/engine/datasource/httpclient/nethttpclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

"github.com/buger/jsonparser"

"github.com/jensneuse/graphql-go-tools/internal/pkg/unsafebytes"
"github.com/jensneuse/graphql-go-tools/pkg/lexer/literal"
)

Expand Down Expand Up @@ -38,7 +37,7 @@ func (n *NetHttpClient) Do(ctx context.Context, requestInput []byte, out io.Writ
url, method, body, headers, queryParams := requestInputParams(requestInput)

// Change to `http.NewRequestWithContext` when support for go 1.12 is dropped
request, err := NewRequestWithContext(ctx, unsafebytes.BytesToString(method), unsafebytes.BytesToString(url), bytes.NewReader(body))
request, err := NewRequestWithContext(ctx, string(method), string(url), bytes.NewReader(body))
if err != nil {
return err
}
Expand All @@ -49,7 +48,7 @@ func (n *NetHttpClient) Do(ctx context.Context, requestInput []byte, out io.Writ
if err != nil {
return
}
request.Header.Add(unsafebytes.BytesToString(key), unsafebytes.BytesToString(value))
request.Header.Add(string(key), string(value))
})
return err
})
Expand Down

0 comments on commit 6c3e11b

Please sign in to comment.