From 7f7fcd0d756416b0a146b6f34a899e59456b2c17 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 10 Mar 2016 11:20:56 +0100 Subject: cookies: first n/v pair in Set-Cookie: is the cookie, then parameters RFC 6265 section 4.1.1 spells out that the first name/value pair in the header is the actual cookie name and content, while the following are the parameters. libcurl previously had a more liberal approach which causes significant problems when introducing new cookie parameters, like the suggested new cookie priority draft. The previous logic read all n/v pairs from left-to-right and the first name used that wassn't a known parameter name would be used as the cookie name, thus accepting "Set-Cookie: Max-Age=2; person=daniel" to be a cookie named 'person' while an RFC 6265 compliant parser should consider that to be a cookie named 'Max-Age' with an (unknown) parameter 'person'. Fixes #709 --- tests/data/test1218 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/data/test1218') diff --git a/tests/data/test1218 b/tests/data/test1218 index ee18cb528..9c2fc0389 100644 --- a/tests/data/test1218 +++ b/tests/data/test1218 @@ -14,7 +14,7 @@ cookies HTTP/1.1 200 OK Date: Tue, 25 Sep 2001 19:37:44 GMT -Set-Cookie: domain=.example.fake; bug=fixed; +Set-Cookie: bug=fixed; domain=.example.fake; Content-Length: 21 This server says moo -- cgit v1.2.3