1<testcase> 2<info> 3<keywords> 4HTTP 5HTTP GET 6cookies 7cookiejar 8</keywords> 9</info> 10# Server-side 11<reply> 12<data> 13HTTP/1.1 200 OK 14Date: Thu, 09 Nov 2010 14:49:00 GMT 15Server: test-server/fake 16Content-Length: 4 17Content-Type: text/html 18Funny-head: yesyes 19Set-Cookie: foobar=name; domain=anything.com; path=/ ; secure 20Set-Cookie:ismatch=this ; domain=127.0.0.1; path=/silly/ 21Set-Cookie: overwrite=this ; domain=127.0.0.1; path=/overwrite/ 22Set-Cookie: overwrite=this2 ; domain=127.0.0.1; path=/overwrite 23Set-Cookie: sec1value=secure1 ; domain=127.0.0.1; path=/secure1/ ; secure 24Set-Cookie: sec2value=secure2 ; domain=127.0.0.1; path=/secure2/ ; secure= 25Set-Cookie: sec3value=secure3 ; domain=127.0.0.1; path=/secure3/ ; secure= 26Set-Cookie: sec4value=secure4 ; secure=; domain=127.0.0.1; path=/secure4/ ; 27Set-Cookie: sec5value=secure5 ; secure; domain=127.0.0.1; path=/secure5/ ; 28Set-Cookie: sec6value=secure6 ; secure ; domain=127.0.0.1; path=/secure6/ ; 29Set-Cookie: sec7value=secure7 ; secure ; domain=127.0.0.1; path=/secure7/ ; 30Set-Cookie: sec8value=secure8 ; secure= ; domain=127.0.0.1; path=/secure8/ ; 31Set-Cookie: secure=very1 ; secure=; domain=127.0.0.1; path=/secure9/; 32Set-Cookie: httpo1=value1 ; domain=127.0.0.1; path=/p1/; httponly 33Set-Cookie: httpo2=value2 ; domain=127.0.0.1; path=/p2/; httponly= 34Set-Cookie: httpo3=value3 ; httponly; domain=127.0.0.1; path=/p3/; 35Set-Cookie: httpo4=value4 ; httponly=; domain=127.0.0.1; path=/p4/; 36Set-Cookie: httponly=myvalue1 ; domain=127.0.0.1; path=/p4/; httponly 37Set-Cookie: httpandsec=myvalue2 ; domain=127.0.0.1; path=/p4/; httponly; secure 38Set-Cookie: httpandsec2=myvalue3; domain=127.0.0.1; path=/p4/; httponly=; secure 39Set-Cookie: httpandsec3=myvalue4 ; domain=127.0.0.1; path=/p4/; httponly; secure= 40Set-Cookie: httpandsec4=myvalue5 ; domain=127.0.0.1; path=/p4/; httponly=; secure= 41Set-Cookie: httpandsec5=myvalue6 ; domain=127.0.0.1; path=/p4/; secure; httponly= 42Set-Cookie: httpandsec6=myvalue7 ; domain=127.0.0.1; path=/p4/; secure=; httponly= 43Set-Cookie: httpandsec7=myvalue8 ; domain=127.0.0.1; path=/p4/; secure; httponly 44Set-Cookie: httpandsec8=myvalue9; domain=127.0.0.1; path=/p4/; secure=; httponly 45Set-Cookie: partmatch=present; domain=127.0.0.1 ; path=/; 46Set-Cookie:eat=this; domain=moo.foo.moo; 47Set-Cookie: eat=this-too; domain=.foo.moo; 48Set-Cookie: nodomainnovalue 49Set-Cookie: nodomain=value; expires=Fri Feb 2 11:56:27 GMT 2035 50Set-Cookie: novalue; domain=reallysilly 51Set-Cookie: test=yes; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2030 52Set-Cookie: test2=yes; domain=se; expires=Sat Feb 2 11:56:27 GMT 2030 53Set-Cookie: magic=yessir; path=/silly/; HttpOnly 54Set-Cookie: blexp=yesyes; domain=.0.0.1; domain=.0.0.1; expiry=totally bad; 55 56boo 57</data> 58</reply> 59 60# Client-side 61<client> 62<server> 63http 64</server> 65 <name> 66HTTP with weirdly formatted cookies and cookiejar storage 67 </name> 68# Explicitly set the time zone to a known good one, in case the user is 69# using one of the 'right' zones that take into account leap seconds 70# which causes the cookie expiry times to be different. 71<setenv> 72TZ=GMT 73</setenv> 74 <command> 75http://%HOSTIP:%HTTPPORT/we/want/31 -b none -c log/jar31.txt 76</command> 77<precheck> 78perl -e 'if ("%HOSTIP" !~ /127\.0\.0\.1$/) {print "Test only works for HOSTIP 127.0.0.1"; exit(1)}' 79</precheck> 80</client> 81 82# Verify data after the test has been "shot" 83<verify> 84<strip> 85^User-Agent:.* 86</strip> 87<protocol> 88GET /we/want/31 HTTP/1.1 89Host: %HOSTIP:%HTTPPORT 90Accept: */* 91 92</protocol> 93<file name="log/jar31.txt" mode="text"> 94# Netscape HTTP Cookie File 95# http://curl.haxx.se/docs/http-cookies.html 96# This file was generated by libcurl! Edit at your own risk. 97 98.127.0.0.1 TRUE /silly/ FALSE 0 ismatch this 99.127.0.0.1 TRUE /overwrite FALSE 0 overwrite this2 100.127.0.0.1 TRUE /secure1/ TRUE 0 sec1value secure1 101.127.0.0.1 TRUE /secure2/ TRUE 0 sec2value secure2 102.127.0.0.1 TRUE /secure3/ TRUE 0 sec3value secure3 103.127.0.0.1 TRUE /secure4/ TRUE 0 sec4value secure4 104.127.0.0.1 TRUE /secure5/ TRUE 0 sec5value secure5 105.127.0.0.1 TRUE /secure6/ TRUE 0 sec6value secure6 106.127.0.0.1 TRUE /secure7/ TRUE 0 sec7value secure7 107.127.0.0.1 TRUE /secure8/ TRUE 0 sec8value secure8 108.127.0.0.1 TRUE /secure9/ TRUE 0 secure very1 109#HttpOnly_.127.0.0.1 TRUE /p1/ FALSE 0 httpo1 value1 110#HttpOnly_.127.0.0.1 TRUE /p2/ FALSE 0 httpo2 value2 111#HttpOnly_.127.0.0.1 TRUE /p3/ FALSE 0 httpo3 value3 112#HttpOnly_.127.0.0.1 TRUE /p4/ FALSE 0 httpo4 value4 113#HttpOnly_.127.0.0.1 TRUE /p4/ FALSE 0 httponly myvalue1 114#HttpOnly_.127.0.0.1 TRUE /p4/ TRUE 0 httpandsec myvalue2 115#HttpOnly_.127.0.0.1 TRUE /p4/ TRUE 0 httpandsec2 myvalue3 116#HttpOnly_.127.0.0.1 TRUE /p4/ TRUE 0 httpandsec3 myvalue4 117#HttpOnly_.127.0.0.1 TRUE /p4/ TRUE 0 httpandsec4 myvalue5 118#HttpOnly_.127.0.0.1 TRUE /p4/ TRUE 0 httpandsec5 myvalue6 119#HttpOnly_.127.0.0.1 TRUE /p4/ TRUE 0 httpandsec6 myvalue7 120#HttpOnly_.127.0.0.1 TRUE /p4/ TRUE 0 httpandsec7 myvalue8 121#HttpOnly_.127.0.0.1 TRUE /p4/ TRUE 0 httpandsec8 myvalue9 122.127.0.0.1 TRUE / FALSE 0 partmatch present 123127.0.0.1 FALSE /we/want/ FALSE 2054030187 nodomain value 124#HttpOnly_127.0.0.1 FALSE /silly/ FALSE 0 magic yessir 125.0.0.1 TRUE /we/want/ FALSE 0 blexp yesyes 126</file> 127</verify> 128</testcase> 129