Commit af2d25ef authored by wangmingming's avatar wangmingming

gzip解压缩问题

parent ca180b13
...@@ -90,7 +90,7 @@ func (c *Client) GetSessionCookies() map[string]string { ...@@ -90,7 +90,7 @@ func (c *Client) GetSessionCookies() map[string]string {
func (c *Client) GetText() string { func (c *Client) GetText() string {
defer c.Response.Body.Close() defer c.Response.Body.Close()
//http.DecompressBody(c.Response) http.DecompressBody(c.Response)
rb, _ := io.ReadAll(c.Response.Body) rb, _ := io.ReadAll(c.Response.Body)
return string(rb) return string(rb)
} }
...@@ -98,8 +98,9 @@ func (c *Client) GetText() string { ...@@ -98,8 +98,9 @@ func (c *Client) GetText() string {
func (c *Client) GetRespUrl() string { func (c *Client) GetRespUrl() string {
location, err := c.Response.Location() location, err := c.Response.Location()
if err != nil { if err != nil {
return "" return c.uri.String()
} }
return location.RequestURI() return location.RequestURI()
} }
......
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