Loop through set-cookie header and set in client only if its actually connect.sid

master
Thomas Lynch 2 years ago
parent 3fac0d046f
commit c86ef11ff4
  1. 6
      app/jschan.go

@ -83,7 +83,11 @@ func (c *Client) sendRequest(req *http.Request, v interface{}, h *ReturnHeaders)
setCookieValue := h.Get("Set-Cookie")
if setCookieValue != "" {
parsedSetCookie := cookieHeader(setCookieValue)
c.SessionCookie = parsedSetCookie[0].Value
for _, parsedCookie := range parsedSetCookie {
if parsedCookie.Name == "connect.sid" {
c.SessionCookie = parsedCookie.Value
}
}
}
if v != nil {

Loading…
Cancel
Save