Skip to content

Multiple Cookie headers in request #719

@NAR

Description

@NAR

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?

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions