Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Cookie headers in request #719

Open
NAR opened this issue Apr 19, 2023 · 1 comment
Open

Multiple Cookie headers in request #719

NAR opened this issue Apr 19, 2023 · 1 comment
Assignees

Comments

@NAR
Copy link

NAR commented Apr 19, 2023

Hello!

I was playing around with hackney and tried to set multiple cookies in the same request. I used this example code:

hackney:request(get,"http://httpbin.org/cookies",[{<<"Accept">>,<<"application/json">>}],<<>>,[{cookie,[{<<"test1">>,<<"value1">>,[]},{<<"test2">>,<<"value2">>,[]}]}, {use_cookies,true}]).

When I checked the sent request with Wireshark, I saw this:

GET /cookies HTTP/1.1
Accept: application/json
Host: httpbin.org
User-Agent: hackney/1.18.1
Cookie: test1=value1; Version=1
Cookie: test2=value2; Version=1

However, RFC 6265 explicitly says that "When the user agent generates an HTTP request, the user agent MUST NOT attach more than one Cookie header field.". Is it intentional that hackney adds multiple Cookie headers to the request or is it a bug?

@benoitc benoitc self-assigned this Oct 10, 2023
@benoitc
Copy link
Owner

benoitc commented Oct 10, 2023

it was surely intentional :) But there may have been some confiusion with the Set-Cookie header. A fix for it would be nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants