Description
If you manually pass Cookie
header in DialContext(..., http.Header)
, cookies from Dialer.Jar
will be overwritten.
Steps to Reproduce
dialer := websocket.Dialer{
Jar: jar,
}
header := http.Header{}
header.Set("Cookie", "some_cookie_name=some_cookie_value")
... = dialer.DialContext(ctx, url, header)
Possible reason
From the first look I would say that this is happening because the part of code which is responsible for setting up all the passed headers ignores already applied Cookie
header from http.CookieJar
.