test61 (1967B)
1 <testcase> 2 <info> 3 <keywords> 4 HTTP 5 HTTP GET 6 cookies 7 cookiejar 8 HTTP replaced headers 9 httponly 10 </keywords> 11 </info> 12 # Server-side 13 <reply> 14 <data> 15 HTTP/1.1 200 OK 16 Date: Tue, 09 Nov 2010 14:49:00 GMT 17 Server: test-server/fake 18 Content-Type: text/html 19 Funny-head: yesyes 20 %if large-time 21 Set-Cookie: test=yes; httponly; domain=foo.com; expires=Fri Feb 13 11:56:27 GMT 2525 22 SET-COOKIE: test2=yes; domain=host.foo.com; expires=Fri Feb 13 11:56:27 GMT 2525 23 %else 24 Set-Cookie: test=yes; httponly; domain=foo.com; expires=Fri Feb 13 11:56:27 GMT 2037 25 SET-COOKIE: test2=yes; domain=host.foo.com; expires=Fri Feb 13 11:56:27 GMT 2037 26 %endif 27 Set-Cookie: test3=maybe; domain=foo.com; path=/moo; secure 28 Set-Cookie: test4=no; domain=nope.foo.com; path=/moo; secure 29 Set-Cookie: test5=name; domain=anything.com; path=/ ; secure 30 Set-Cookie: fake=fooledyou; domain=..com; path=/; 31 Set-Cookie: supercookie=fooledyou; domain=.com; path=/; 32 Content-Length: 4 33 34 boo 35 </data> 36 </reply> 37 38 # Client-side 39 <client> 40 <server> 41 http 42 </server> 43 <name> 44 HTTP with various cookies and custom Host: 45 </name> 46 # Explicitly set the time zone to a known good one, in case the user is 47 # using one of the 'right' zones that take into account leap seconds 48 # which causes the cookie expiry times to be different. 49 <setenv> 50 TZ=GMT 51 </setenv> 52 <command> 53 http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -c %LOGDIR/jar%TESTNUMBER.txt -H "Host: www.host.foo.com" 54 </command> 55 <features> 56 cookies 57 </features> 58 </client> 59 60 # Verify data after the test has been "shot" 61 <verify> 62 <protocol> 63 GET /we/want/%TESTNUMBER HTTP/1.1 64 Host: www.host.foo.com 65 User-Agent: curl/%VERSION 66 Accept: */* 67 68 </protocol> 69 <file name="%LOGDIR/jar%TESTNUMBER.txt" mode="text"> 70 # Netscape HTTP Cookie File 71 # https://curl.se/docs/http-cookies.html 72 # This file was generated by libcurl! Edit at your own risk. 73 74 .host.foo.com TRUE /we/want/ FALSE %days[400] test2 yes 75 #HttpOnly_.foo.com TRUE /we/want/ FALSE %days[400] test yes 76 </file> 77 </verify> 78 </testcase>