xref: /curl/tests/data/test2081 (revision 3fd80c7b)
1<testcase>
2<info>
3<keywords>
4HTTP
5HTTP GET
6referer
7followlocation
8--write-out
9</keywords>
10</info>
11
12# Server-side
13<reply>
14<data nocheck="yes">
15HTTP/1.1 301 This is a weirdo text message swsclose
16Location: data/%TESTNUMBER0002.txt?coolsite=yes
17Content-Length: 62
18Connection: close
19
20This server reply is for testing a simple Location: following
21</data>
22<data2>
23HTTP/1.1 200 This is another weirdo text message swsclose
24Connection: close
25
26Thanks for following.
27</data2>
28</reply>
29
30# Client-side
31<client>
32<server>
33http
34</server>
35<name>
36Automatic referrer credential and anchor stripping check
37</name>
38<command>
39http://user:pass@%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER#anchor --location --referer ';auto' --write-out '%{referer}\n'
40</command>
41</client>
42
43# Verify data after the test has been "shot"
44<verify>
45<protocol>
46GET /we/want/our/%TESTNUMBER HTTP/1.1
47Host: %HOSTIP:%HTTPPORT
48Authorization: Basic dXNlcjpwYXNz
49User-Agent: curl/%VERSION
50Accept: */*
51
52GET /we/want/our/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1
53Host: %HOSTIP:%HTTPPORT
54Authorization: Basic dXNlcjpwYXNz
55User-Agent: curl/%VERSION
56Accept: */*
57Referer: http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER
58
59</protocol>
60<stdout>
61HTTP/1.1 301 This is a weirdo text message swsclose
62Location: data/%TESTNUMBER0002.txt?coolsite=yes
63Content-Length: 62
64Connection: close
65
66HTTP/1.1 200 This is another weirdo text message swsclose
67Connection: close
68
69Thanks for following.
70http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER
71</stdout>
72</verify>
73</testcase>
74