Merge pull request #85 from Zangwill/patch-5
修复 Get "https://webpus.../synccheck?... 退出问题
This commit is contained in:
commit
c2641bd6ad
@ -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{})
|
||||
|
Loading…
x
Reference in New Issue
Block a user