We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 86f9d00 commit dee9534Copy full SHA for dee9534
pkg/utils/httpreq/httpreq.go
@@ -5,6 +5,7 @@ import (
5
"encoding/json"
6
"fmt"
7
"net/http"
8
+ "time"
9
10
jsoniter "github.com/json-iterator/go"
11
)
@@ -13,9 +14,14 @@ type Client struct {
13
14
httpClient *http.Client
15
}
16
17
+const defaultTimeout = 10 * time.Second
18
+
19
func NewClient() *Client {
20
return &Client{
- httpClient: http.DefaultClient,
21
+ httpClient: &http.Client{
22
+ Transport: http.DefaultClient.Transport,
23
+ Timeout: defaultTimeout,
24
+ },
25
26
27
0 commit comments