lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | <testcase> |
| 2 | <info> |
| 3 | <keywords> |
| 4 | FTP |
| 5 | HTTP |
| 6 | HTTP GET |
| 7 | --proto |
| 8 | --proto-redir |
| 9 | followlocation |
| 10 | </keywords> |
| 11 | </info> |
| 12 | |
| 13 | # |
| 14 | # Server-side |
| 15 | <reply> |
| 16 | <data> |
| 17 | HTTP/1.1 301 OK swsclose
|
| 18 | Date: Thu, 09 Nov 2010 14:49:00 GMT
|
| 19 | Server: test-server/fake
|
| 20 | Content-Length: 0
|
| 21 | Location: ftp://127.0.0.1:8992/1245
|
| 22 | Connection: close
|
| 23 |
|
| 24 | </data> |
| 25 | </reply> |
| 26 | |
| 27 | # |
| 28 | # Client-side |
| 29 | <client> |
| 30 | <server> |
| 31 | http |
| 32 | ftp |
| 33 | </server> |
| 34 | <name> |
| 35 | --proto deny must override --proto-redir allow |
| 36 | </name> |
| 37 | <command> |
| 38 | --location --proto +all,-ftp --proto-redir -all,+ftp http://%HOSTIP:%HTTPPORT/1245 |
| 39 | </command> |
| 40 | # The data section doesn't do variable substitution, so we must assert this |
| 41 | <precheck> |
| 42 | perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%FTPPORT' ne '8992' );" |
| 43 | </precheck> |
| 44 | </client> |
| 45 | |
| 46 | # |
| 47 | # Verify data after the test has been "shot" |
| 48 | <verify> |
| 49 | <strip> |
| 50 | ^User-Agent:.* |
| 51 | </strip> |
| 52 | <protocol> |
| 53 | GET /1245 HTTP/1.1
|
| 54 | Host: %HOSTIP:%HTTPPORT
|
| 55 | Accept: */*
|
| 56 |
|
| 57 | </protocol> |
| 58 | # 1 - Protocol ftp not supported or disabled in libcurl |
| 59 | <errorcode> |
| 60 | 1 |
| 61 | </errorcode> |
| 62 | </verify> |
| 63 | </testcase> |