mirror of
https://github.com/datarhei/core.git
synced 2025-10-07 08:51:04 +08:00
Use clone of http.Transport defaults
This commit is contained in:
@@ -369,10 +369,9 @@ func (c *APIClient) call(method, path, contentType string, data io.Reader, origi
|
||||
|
||||
func (c *APIClient) request(req *http.Request) (int, io.ReadCloser, error) {
|
||||
if c.Client == nil {
|
||||
tr := &http.Transport{
|
||||
MaxIdleConns: 10,
|
||||
IdleConnTimeout: 30 * time.Second,
|
||||
}
|
||||
tr := http.DefaultTransport.(*http.Transport).Clone()
|
||||
tr.MaxIdleConns = 10
|
||||
tr.IdleConnTimeout = 30 * time.Second
|
||||
|
||||
c.Client = &http.Client{
|
||||
Transport: tr,
|
||||
|
Reference in New Issue
Block a user