test2045 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <testcase>
  2. <info>
  3. <keywords>
  4. FTP
  5. --proto-default
  6. </keywords>
  7. </info>
  8. #
  9. # Server-side
  10. <reply>
  11. <!--
  12. The purpose of this test is to make sure the --proto-default option works
  13. properly. We specify a default protocol of FTP and if the option works properly
  14. curl will use the FTP protocol. If the option is broken however curl will use
  15. the HTTP protocol.
  16. In the broken scenario curl would use HTTP to talk to our FTP server. We handle
  17. that by replying with something that both protocols can understand. Our FTP
  18. server allows a custom welcome message, so we use that feature to make an HTTP
  19. reply that contains an FTP reply (think polyglot). In the case of FTP we expect
  20. curl will return CURLE_WEIRD_SERVER_REPLY so we test for that return code.
  21. -->
  22. <servercmd>
  23. REPLY welcome HTTP/1.1 200 OK\r\nContent-Length: 21\r\n\r\n500 Weird FTP Reply
  24. </servercmd>
  25. </reply>
  26. #
  27. # Client-side
  28. <client>
  29. <features>
  30. none
  31. </features>
  32. <server>
  33. ftp
  34. </server>
  35. <name>
  36. Set the default protocol to ftp for a schemeless URL
  37. </name>
  38. <command>
  39. -H "User-Agent:" -H "Host:" -H "Accept:" --proto-default ftp %HOSTIP:%FTPPORT
  40. </command>
  41. </client>
  42. #
  43. # Verify data after the test has been "shot"
  44. <verify>
  45. # CURLE_WEIRD_SERVER_REPLY is error code 8
  46. <errorcode>
  47. 8
  48. </errorcode>
  49. </verify>
  50. </testcase>