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