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