xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame^] | 1 | <testcase> |
| 2 | <info> |
| 3 | <keywords> |
| 4 | HTTP |
| 5 | HTTP GET |
| 6 | HTTP proxy |
| 7 | HTTP Basic auth |
| 8 | followlocation |
| 9 | netrc |
| 10 | </keywords> |
| 11 | </info> |
| 12 | |
| 13 | # Server-side |
| 14 | <reply> |
| 15 | <data> |
| 16 | HTTP/1.1 301 This is a weirdo text message swsclose |
| 17 | Date: Tue, 09 Nov 2010 14:49:00 GMT |
| 18 | Server: test-server/fake |
| 19 | Location: http://anotherone.com/%TESTNUMBER0002 |
| 20 | Connection: close |
| 21 | |
| 22 | This server reply is for testing a simple Location: following |
| 23 | |
| 24 | </data> |
| 25 | <data2> |
| 26 | HTTP/1.1 302 Followed here fine swsclose |
| 27 | Date: Tue, 09 Nov 2010 14:49:00 GMT |
| 28 | Server: test-server/fake |
| 29 | Location: http://athird.com/%TESTNUMBER0003 |
| 30 | |
| 31 | If this is received, the location following worked |
| 32 | |
| 33 | </data2> |
| 34 | <data3> |
| 35 | HTTP/1.1 200 Followed here fine swsclose |
| 36 | Date: Tue, 09 Nov 2010 14:49:00 GMT |
| 37 | Server: test-server/fake |
| 38 | Content-Length: 52 |
| 39 | |
| 40 | If this is received, the location following worked |
| 41 | |
| 42 | </data3> |
| 43 | <datacheck> |
| 44 | HTTP/1.1 301 This is a weirdo text message swsclose |
| 45 | Date: Tue, 09 Nov 2010 14:49:00 GMT |
| 46 | Server: test-server/fake |
| 47 | Location: http://anotherone.com/%TESTNUMBER0002 |
| 48 | Connection: close |
| 49 | |
| 50 | HTTP/1.1 302 Followed here fine swsclose |
| 51 | Date: Tue, 09 Nov 2010 14:49:00 GMT |
| 52 | Server: test-server/fake |
| 53 | Location: http://athird.com/%TESTNUMBER0003 |
| 54 | |
| 55 | HTTP/1.1 200 Followed here fine swsclose |
| 56 | Date: Tue, 09 Nov 2010 14:49:00 GMT |
| 57 | Server: test-server/fake |
| 58 | Content-Length: 52 |
| 59 | |
| 60 | If this is received, the location following worked |
| 61 | |
| 62 | </datacheck> |
| 63 | </reply> |
| 64 | |
| 65 | # Client-side |
| 66 | <client> |
| 67 | <server> |
| 68 | http |
| 69 | </server> |
| 70 | <name> |
| 71 | HTTP Location: following with --netrc-optional |
| 72 | </name> |
| 73 | <command> |
| 74 | http://supersite.com/want/%TESTNUMBER -L -x http://%HOSTIP:%HTTPPORT --netrc-optional --netrc-file log/netrc%TESTNUMBER |
| 75 | </command> |
| 76 | <features> |
| 77 | proxy |
| 78 | </features> |
| 79 | # netrc auth for two out of three sites: |
| 80 | <file name="log/netrc%TESTNUMBER"> |
| 81 | machine supersite.com login user1 password passwd1 |
| 82 | machine anotherone.com login user2 password passwd2 |
| 83 | </file> |
| 84 | </client> |
| 85 | |
| 86 | # Verify data after the test has been "shot" |
| 87 | <verify> |
| 88 | <protocol> |
| 89 | GET http://supersite.com/want/%TESTNUMBER HTTP/1.1
|
| 90 | Host: supersite.com
|
| 91 | Authorization: Basic dXNlcjE6cGFzc3dkMQ==
|
| 92 | User-Agent: curl/%VERSION
|
| 93 | Accept: */*
|
| 94 | Proxy-Connection: Keep-Alive
|
| 95 |
|
| 96 | GET http://anotherone.com/%TESTNUMBER0002 HTTP/1.1
|
| 97 | Host: anotherone.com
|
| 98 | Authorization: Basic dXNlcjI6cGFzc3dkMg==
|
| 99 | User-Agent: curl/%VERSION
|
| 100 | Accept: */*
|
| 101 | Proxy-Connection: Keep-Alive
|
| 102 |
|
| 103 | GET http://athird.com/%TESTNUMBER0003 HTTP/1.1
|
| 104 | Host: athird.com
|
| 105 | User-Agent: curl/%VERSION
|
| 106 | Accept: */*
|
| 107 | Proxy-Connection: Keep-Alive
|
| 108 |
|
| 109 | </protocol> |
| 110 | </verify> |
| 111 | </testcase> |