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.

Activity

ghost removed
bugSomething isn't working
on Dec 20, 2021
changed the title [-][bug] Manually passed `Cookie` header overrides `http.CookieJar` cookies[/-] [+]Manually passed `Cookie` header overrides `http.CookieJar` cookies[/+] on Jul 16, 2023
moved this to 🏗 In progress in Gorilla Web Toolkiton Jul 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      Manually passed `Cookie` header overrides `http.CookieJar` cookies · Issue #597 · gorilla/websocket