From 7f942a92ead7f2b429656d376b3372e5e2f36021 Mon Sep 17 00:00:00 2001 From: eatMoreApple <15055461510@163.com> Date: Sun, 16 May 2021 16:56:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DcookeieMap=E8=BF=87=E5=A4=A7?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index 65ea6fe..ac3042c 100644 --- a/client.go +++ b/client.go @@ -87,7 +87,8 @@ func (c *Client) setCookie(resp *http.Response) { if c.cookies == nil { c.cookies = make(map[string][]*http.Cookie) } - c.cookies[resp.Request.URL.String()] = cookies + path := fmt.Sprintf("%s://%s%s", resp.Request.URL.Scheme, resp.Request.URL.Host, resp.Request.URL.Path) + c.cookies[path] = cookies } // 抽象Do方法,将所有的有效的cookie存入Client.cookies