Skip to content

Manually passed Cookie header overrides http.CookieJar cookies #597

@yauheni-chaburanau-it

Description

@yauheni-chaburanau-it

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    🏗 In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions