mirror of
https://github.com/moparisthebest/curl
synced 2024-11-18 07:25:14 -05:00
e2ef8d6fa1
According to RFC6265 section 5.4, cookies with equal path lengths SHOULD be sorted by creation-time (earlier first). This adds a creation-time record to the cookie struct in order to make cookie sorting more deterministic. The creation-time is defined as the order of the cookies in the jar, the first cookie read fro the jar being the oldest. The creation-time is thus not serialized into the jar. Also remove the strcmp() matching in the sorting as there is no lexicographic ordering in RFC6265. Existing tests are updated to match. Closes #2524
65 lines
1.3 KiB
Plaintext
65 lines
1.3 KiB
Plaintext
<testcase>
|
|
<info>
|
|
<keywords>
|
|
HTTP
|
|
HTTP GET
|
|
HTTP proxy
|
|
cookies
|
|
cookiejar
|
|
PSL
|
|
</keywords>
|
|
</info>
|
|
|
|
# Server-side
|
|
<reply>
|
|
<data>
|
|
HTTP/1.1 200 OK
|
|
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
|
Server: test-server/fake
|
|
Content-Length: 4
|
|
Content-Type: text/html
|
|
Funny-head: yesyes
|
|
Set-Cookie: test1=forbidden1; domain=example.ck; path=/;
|
|
Set-Cookie: test2=allowed2; domain=www.example.ck; path=/;
|
|
Set-Cookie: test3=forbidden3; domain=ck; path=/;
|
|
Set-Cookie: test4=allowed4; domain=www.ck; path=/;
|
|
Set-Cookie: test5=forbidden5; domain=z-1.compute-1.amazonaws.com; path=/;
|
|
|
|
boo
|
|
</data>
|
|
</reply>
|
|
|
|
# Client-side
|
|
<client>
|
|
<features>
|
|
PSL
|
|
</features>
|
|
<server>
|
|
http
|
|
</server>
|
|
<name>
|
|
Check cookies against PSL
|
|
</name>
|
|
<setenv>
|
|
TZ=GMT
|
|
</setenv>
|
|
<command>
|
|
http://www.example.ck/1136 http://www.ck/1136 http://z-1.compute-1.amazonaws.com/1136 -b none -c log/jar1136.txt -x %HOSTIP:%HTTPPORT
|
|
</command>
|
|
|
|
</client>
|
|
|
|
# Verify data after the test has been "shot"
|
|
<verify>
|
|
<file name="log/jar1136.txt" mode="text">
|
|
# Netscape HTTP Cookie File
|
|
# https://curl.haxx.se/docs/http-cookies.html
|
|
# This file was generated by libcurl! Edit at your own risk.
|
|
|
|
.z-1.compute-1.amazonaws.com TRUE / FALSE 0 test5 forbidden5
|
|
.www.ck TRUE / FALSE 0 test4 allowed4
|
|
.www.example.ck TRUE / FALSE 0 test2 allowed2
|
|
</file>
|
|
</verify>
|
|
</testcase>
|