test728 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP GET
  6. SOCKS5
  7. SOCKS5h
  8. followlocation
  9. </keywords>
  10. </info>
  11. #
  12. # Server-side
  13. <reply>
  14. # The hostname in this redirect is 256 characters and too long (> 255) for
  15. # SOCKS5 remote resolve. curl must return error CURLE_PROXY in this case.
  16. <data>
  17. HTTP/1.1 301 Moved Permanently
  18. Location: http://AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/
  19. Content-Length: 0
  20. Connection: close
  21. </data>
  22. </reply>
  23. #
  24. # Client-side
  25. <client>
  26. <features>
  27. proxy
  28. </features>
  29. <server>
  30. http
  31. socks5
  32. </server>
  33. <name>
  34. SOCKS5h with HTTP redirect to hostname too long
  35. </name>
  36. <command>
  37. --no-progress-meter --location --proxy socks5h://%HOSTIP:%SOCKSPORT http://%HOSTIP:%HTTPPORT/%TESTNUMBER
  38. </command>
  39. </client>
  40. #
  41. # Verify data after the test has been "shot"
  42. <verify>
  43. <protocol crlf="yes">
  44. GET /%TESTNUMBER HTTP/1.1
  45. Host: %HOSTIP:%HTTPPORT
  46. User-Agent: curl/%VERSION
  47. Accept: */*
  48. </protocol>
  49. <errorcode>
  50. 97
  51. </errorcode>
  52. # the error message is verified because error code CURLE_PROXY (97) may be
  53. # returned for any number of reasons and we need to make sure it is
  54. # specifically for the reason below so that we know the check is working.
  55. <stderr mode="text">
  56. curl: (97) SOCKS5: the destination hostname is too long to be resolved remotely by the proxy.
  57. </stderr>
  58. </verify>
  59. </testcase>