Commit 6e03f707 authored by wangmingming's avatar wangmingming

11

parent e1eb899d
Pipeline #359 canceled with stages
...@@ -35,7 +35,7 @@ func (c *Client) Start() error { ...@@ -35,7 +35,7 @@ func (c *Client) Start() error {
return errors.New("未设置cookie") return errors.New("未设置cookie")
} }
var cookies []*http.Cookie var cookies []*http.Cookie
cks := strings.Split(cookie, ";") cks := strings.Split(cookie, "; ")
for _, ck := range cks { for _, ck := range cks {
t := strings.Split(strings.TrimSpace(ck), "=") t := strings.Split(strings.TrimSpace(ck), "=")
cookies = append(cookies, &http.Cookie{ cookies = append(cookies, &http.Cookie{
...@@ -97,6 +97,7 @@ func (c *Client) GetRespUrl() string { ...@@ -97,6 +97,7 @@ func (c *Client) GetRespUrl() string {
location, err := c.Response.Location() location, err := c.Response.Location()
if err != nil { if err != nil {
logrus.Error("获取respUrl失败 ", err) logrus.Error("获取respUrl失败 ", err)
return ""
} }
return location.RequestURI() return location.RequestURI()
} }
...@@ -124,5 +125,5 @@ func NewClient(forWard ForwardItem) (Client, error) { ...@@ -124,5 +125,5 @@ func NewClient(forWard ForwardItem) (Client, error) {
if err != nil { if err != nil {
return Client{}, err return Client{}, err
} }
return Client{Client: client, Item: forWard}, nil return Client{Client: client, Item: forWard, Jar: jar}, nil
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment