2019-10-05 21:53:22 +05:00
|
|
|
package requester
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net"
|
|
|
|
"net/http"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2021-11-20 23:06:40 +05:00
|
|
|
// nolint:exhaustivestruct
|
2019-10-05 21:53:22 +05:00
|
|
|
func getHTTPClient() *http.Client {
|
2022-06-29 15:04:57 +05:00
|
|
|
// nolint:exhaustruct
|
2021-11-20 23:06:40 +05:00
|
|
|
client := &http.Client{
|
2019-10-05 21:53:22 +05:00
|
|
|
Transport: &http.Transport{
|
|
|
|
ExpectContinueTimeout: time.Second * 5,
|
|
|
|
DialContext: (&net.Dialer{
|
|
|
|
Timeout: time.Second * 5,
|
|
|
|
}).DialContext,
|
|
|
|
ResponseHeaderTimeout: time.Second * 5,
|
2019-10-07 22:33:05 +05:00
|
|
|
TLSHandshakeTimeout: time.Second * 10,
|
2019-10-05 21:53:22 +05:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2021-11-20 23:06:40 +05:00
|
|
|
return client
|
2019-10-05 21:53:22 +05:00
|
|
|
}
|