xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 1 | <testcase> |
| 2 | <info> |
| 3 | <keywords> |
| 4 | HTTP |
| 5 | HTTP GET |
| 6 | cookies |
| 7 | header dump |
| 8 | </keywords> |
| 9 | </info> |
| 10 | |
| 11 | # This test verifies that the cookie file gets created even if the last cookie |
| 12 | # has been removed - particularly important when the file is going to be read |
| 13 | # again and thus must not contain old contents. |
| 14 | |
| 15 | # Server-side |
| 16 | <reply> |
| 17 | <data> |
| 18 | HTTP/1.1 200 OK |
| 19 | Date: Tue, 09 Nov 2010 14:49:00 GMT |
| 20 | Server: test-server/fake |
| 21 | Content-Type: text/html |
| 22 | Funny-head: yesyes swsclose |
| 23 | Set-Cookie: foobar=name; expires=Thu, 22 Nov 2037 10:54:11 GMT; |
| 24 | |
| 25 | </data> |
| 26 | <data2> |
| 27 | HTTP/1.1 200 OK |
| 28 | Date: Tue, 09 Nov 2010 14:49:00 GMT |
| 29 | Server: test-server/fake |
| 30 | Content-Type: text/html |
| 31 | Funny-head: yesyes swsclose |
| 32 | Set-Cookie: foobar=name; expires=Thu, 01 Jan 1970 00:00:00 GMT; |
| 33 | |
| 34 | </data2> |
| 35 | </reply> |
| 36 | |
| 37 | # Client-side |
| 38 | <client> |
| 39 | <server> |
| 40 | http |
| 41 | </server> |
| 42 | <name> |
| 43 | HTTP with cookiejar without cookies left |
| 44 | </name> |
| 45 | <command> |
| 46 | http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -b none -c log/cookies%TESTNUMBER http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER0002 |
| 47 | </command> |
| 48 | </client> |
| 49 | |
| 50 | # Verify data after the test has been "shot" |
| 51 | <verify> |
| 52 | <protocol> |
| 53 | GET /we/want/%TESTNUMBER HTTP/1.1
|
| 54 | Host: %HOSTIP:%HTTPPORT
|
| 55 | User-Agent: curl/%VERSION
|
| 56 | Accept: */*
|
| 57 |
|
| 58 | GET /we/want/%TESTNUMBER0002 HTTP/1.1
|
| 59 | Host: %HOSTIP:%HTTPPORT
|
| 60 | User-Agent: curl/%VERSION
|
| 61 | Accept: */*
|
| 62 | Cookie: foobar=name
|
| 63 |
|
| 64 | </protocol> |
| 65 | <file name="log/cookies%TESTNUMBER" mode="text"> |
| 66 | # Netscape HTTP Cookie File |
| 67 | # https://curl.se/docs/http-cookies.html |
| 68 | # This file was generated by libcurl! Edit at your own risk. |
| 69 | |
| 70 | </file> |
| 71 | </verify> |
| 72 | </testcase> |