2008-08-24 05:27:58 +08:00
|
|
|
<testcase>
|
|
|
|
<info>
|
|
|
|
<keywords>
|
|
|
|
HTTP
|
|
|
|
HTTP GET
|
|
|
|
followlocation
|
|
|
|
</keywords>
|
|
|
|
</info>
|
|
|
|
# Server-side
|
|
|
|
<reply>
|
|
|
|
<data>
|
|
|
|
HTTP/1.1 301 This is a weirdo text message swsclose
|
2020-02-28 22:00:03 +08:00
|
|
|
Date: Tue, 09 Nov 2010 14:49:00 GMT
|
2008-08-24 05:27:58 +08:00
|
|
|
Server: test-server/fake
|
2021-03-13 00:38:26 +08:00
|
|
|
Location: data/%TESTNUMBER0002.txt?coolsite=yes
|
2008-08-24 05:27:58 +08:00
|
|
|
Connection: close
|
|
|
|
|
|
|
|
This server reply is for testing a simple Location: following
|
|
|
|
|
|
|
|
</data>
|
|
|
|
<data2>
|
|
|
|
HTTP/1.1 200 Followed here fine swsclose
|
2020-02-28 22:00:03 +08:00
|
|
|
Date: Tue, 09 Nov 2010 14:49:00 GMT
|
2008-08-24 05:27:58 +08:00
|
|
|
Server: test-server/fake
|
|
|
|
Content-Length: 52
|
|
|
|
|
|
|
|
If this is received, the location following worked
|
|
|
|
|
|
|
|
</data2>
|
|
|
|
<datacheck>
|
|
|
|
HTTP/1.1 301 This is a weirdo text message swsclose
|
2020-02-28 22:00:03 +08:00
|
|
|
Date: Tue, 09 Nov 2010 14:49:00 GMT
|
2008-08-24 05:27:58 +08:00
|
|
|
Server: test-server/fake
|
2021-03-13 00:38:26 +08:00
|
|
|
Location: data/%TESTNUMBER0002.txt?coolsite=yes
|
2008-08-24 05:27:58 +08:00
|
|
|
Connection: close
|
|
|
|
|
|
|
|
HTTP/1.1 200 Followed here fine swsclose
|
2020-02-28 22:00:03 +08:00
|
|
|
Date: Tue, 09 Nov 2010 14:49:00 GMT
|
2008-08-24 05:27:58 +08:00
|
|
|
Server: test-server/fake
|
|
|
|
Content-Length: 52
|
|
|
|
|
|
|
|
If this is received, the location following worked
|
|
|
|
|
|
|
|
</datacheck>
|
|
|
|
</reply>
|
|
|
|
|
|
|
|
# Client-side
|
|
|
|
<client>
|
|
|
|
<server>
|
|
|
|
http
|
|
|
|
</server>
|
2023-10-04 17:35:54 +08:00
|
|
|
<name>
|
2008-08-24 05:27:58 +08:00
|
|
|
HTTP Location: following with auto-referer
|
2023-10-04 17:35:54 +08:00
|
|
|
</name>
|
|
|
|
<command>
|
2021-03-13 00:38:26 +08:00
|
|
|
http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER --silent --location --referer "firstone.html;auto" --write-out "%{stderr}|%{referer}|"
|
2008-08-24 05:27:58 +08:00
|
|
|
</command>
|
|
|
|
</client>
|
|
|
|
|
|
|
|
# Verify data after the test has been "shot"
|
|
|
|
<verify>
|
|
|
|
<protocol>
|
2021-03-13 00:38:26 +08:00
|
|
|
GET /want/%TESTNUMBER HTTP/1.1
|
2008-08-24 05:27:58 +08:00
|
|
|
Host: %HOSTIP:%HTTPPORT
|
2020-10-02 19:45:24 +08:00
|
|
|
User-Agent: curl/%VERSION
|
2008-08-24 05:27:58 +08:00
|
|
|
Accept: */*
|
|
|
|
Referer: firstone.html
|
|
|
|
|
2021-03-13 00:38:26 +08:00
|
|
|
GET /want/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1
|
2008-08-24 05:27:58 +08:00
|
|
|
Host: %HOSTIP:%HTTPPORT
|
2020-10-02 19:45:24 +08:00
|
|
|
User-Agent: curl/%VERSION
|
2008-08-24 05:27:58 +08:00
|
|
|
Accept: */*
|
2021-03-13 00:38:26 +08:00
|
|
|
Referer: http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER
|
2008-08-24 05:27:58 +08:00
|
|
|
|
|
|
|
</protocol>
|
2021-02-19 21:57:19 +08:00
|
|
|
<stderr nonewline="yes">
|
2021-03-13 00:38:26 +08:00
|
|
|
|http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER|
|
2021-02-19 21:57:19 +08:00
|
|
|
</stderr>
|
2008-08-24 05:27:58 +08:00
|
|
|
</verify>
|
|
|
|
</testcase>
|