diff --git a/client.go b/client.go index f7fe433..7ea5bcd 100644 --- a/client.go +++ b/client.go @@ -54,11 +54,13 @@ func NewClient(client *http.Client) *Client { // 设置客户端不自动跳转 func DefaultClient() *Client { jar, _ := cookiejar.New(nil) + timeout := time.Duration(30 * time.Second) client := &http.Client{ CheckRedirect: func(req *http.Request, via []*http.Request) error { return http.ErrUseLastResponse }, Jar: jar, + Timeout: timeout, } c := NewClient(client) c.AddHttpHook(UserAgentHook{})