()
| 22 | const UserAgentNT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Safari/537.36 Chrome/142.0.0.0 OpenList/425.6.30" |
| 23 | |
| 24 | func InitClient() { |
| 25 | NoRedirectClient = resty.New().SetRedirectPolicy( |
| 26 | resty.RedirectPolicyFunc(func(req *http.Request, via []*http.Request) error { |
| 27 | return http.ErrUseLastResponse |
| 28 | }), |
| 29 | ).SetTLSClientConfig(&tls.Config{InsecureSkipVerify: conf.Conf.TlsInsecureSkipVerify}) |
| 30 | NoRedirectClient.SetHeader("user-agent", UserAgent) |
| 31 | net.SetRestyProxyIfConfigured(NoRedirectClient) |
| 32 | |
| 33 | RestyClient = NewRestyClient() |
| 34 | HttpClient = net.NewHttpClient() |
| 35 | } |
| 36 | |
| 37 | func NewRestyClient() *resty.Client { |
| 38 | client := resty.New(). |
no test coverage detected