fix issue in dupicated expiration handling in response cookies og ghttp.Client
@@ -10,7 +10,6 @@ import (
"github.com/gogf/gf/util/gconv"
"io/ioutil"
"net/http"
- "time"
)
// ClientResponse is the struct for client request response.
@@ -22,12 +21,8 @@ type ClientResponse struct {
// initCookie initializes the cookie map attribute of ClientResponse.
func (r *ClientResponse) initCookie() {
if r.cookies == nil {
- now := time.Now()
r.cookies = make(map[string]string)
for _, v := range r.Cookies() {
- if v.Expires.UnixNano() < now.UnixNano() {
- continue
- }
r.cookies[v.Name] = v.Value
}
}
