xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 1 | <testcase> |
| 2 | <info> |
| 3 | <keywords> |
| 4 | HTTP |
| 5 | HTTP GET |
| 6 | followlocation |
| 7 | </keywords> |
| 8 | </info> |
| 9 | # Server-side |
| 10 | <reply> |
| 11 | <data> |
| 12 | HTTP/1.1 301 This is a weirdo text message swsclose |
| 13 | Date: Tue, 09 Nov 2010 14:49:00 GMT |
| 14 | Server: test-server/fake |
| 15 | Location: data/%TESTNUMBER0002.txt?coolsite=yes |
| 16 | Connection: close |
| 17 | |
| 18 | This server reply is for testing a simple Location: following |
| 19 | |
| 20 | </data> |
| 21 | <data2> |
| 22 | HTTP/1.1 200 Followed here fine swsclose |
| 23 | Date: Tue, 09 Nov 2010 14:49:00 GMT |
| 24 | Server: test-server/fake |
| 25 | Content-Length: 52 |
| 26 | |
| 27 | If this is received, the location following worked |
| 28 | |
| 29 | </data2> |
| 30 | <datacheck> |
| 31 | HTTP/1.1 301 This is a weirdo text message swsclose |
| 32 | Date: Tue, 09 Nov 2010 14:49:00 GMT |
| 33 | Server: test-server/fake |
| 34 | Location: data/%TESTNUMBER0002.txt?coolsite=yes |
| 35 | Connection: close |
| 36 | |
| 37 | HTTP/1.1 200 Followed here fine swsclose |
| 38 | Date: Tue, 09 Nov 2010 14:49:00 GMT |
| 39 | Server: test-server/fake |
| 40 | Content-Length: 52 |
| 41 | |
| 42 | If this is received, the location following worked |
| 43 | |
| 44 | </datacheck> |
| 45 | </reply> |
| 46 | |
| 47 | # Client-side |
| 48 | <client> |
| 49 | <server> |
| 50 | http |
| 51 | </server> |
| 52 | <name> |
| 53 | HTTP Location: following with auto-referer |
| 54 | </name> |
| 55 | <command> |
| 56 | http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER --silent --location --referer "firstone.html;auto" --write-out "%{stderr}|%{referer}|" |
| 57 | </command> |
| 58 | </client> |
| 59 | |
| 60 | # Verify data after the test has been "shot" |
| 61 | <verify> |
| 62 | <protocol> |
| 63 | GET /want/%TESTNUMBER HTTP/1.1
|
| 64 | Host: %HOSTIP:%HTTPPORT
|
| 65 | User-Agent: curl/%VERSION
|
| 66 | Accept: */*
|
| 67 | Referer: firstone.html
|
| 68 |
|
| 69 | GET /want/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1
|
| 70 | Host: %HOSTIP:%HTTPPORT
|
| 71 | User-Agent: curl/%VERSION
|
| 72 | Accept: */*
|
| 73 | Referer: http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER
|
| 74 |
|
| 75 | </protocol> |
| 76 | <stderr nonewline="yes"> |
| 77 | |http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER| |
| 78 | </stderr> |
| 79 | </verify> |
| 80 | </testcase> |