test1287 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP GET
  6. HTTP CONNECT
  7. proxytunnel
  8. verbose logs
  9. </keywords>
  10. </info>
  11. #
  12. # Server-side
  13. <reply>
  14. <data>
  15. HTTP/1.1 200 OK
  16. Date: Tue, 09 Nov 2010 14:49:00 GMT
  17. Server: test-server/fake swsclose
  18. Content-Type: text/html
  19. Funny-head: yesyes
  20. Content-Length: 9
  21. contents
  22. </data>
  23. # The purpose of this test is to make sure curl ignores headers
  24. # Content-Length and Transfer-Encoding in a successful CONNECT 2xx reply.
  25. <connect>
  26. HTTP/1.1 200 Mighty fine indeed
  27. Content-Length: 123
  28. Transfer-Encoding: chunked
  29. </connect>
  30. <datacheck>
  31. HTTP/1.1 200 Mighty fine indeed
  32. Content-Length: 123
  33. Transfer-Encoding: chunked
  34. HTTP/1.1 200 OK
  35. Date: Tue, 09 Nov 2010 14:49:00 GMT
  36. Server: test-server/fake swsclose
  37. Content-Type: text/html
  38. Funny-head: yesyes
  39. Content-Length: 9
  40. contents
  41. </datacheck>
  42. </reply>
  43. #
  44. # Client-side
  45. <client>
  46. <server>
  47. http
  48. http-proxy
  49. </server>
  50. <name>
  51. HTTP over proxy-tunnel ignore TE and CL in CONNECT 2xx responses
  52. </name>
  53. <command>
  54. -v --proxytunnel -x %HOSTIP:%PROXYPORT http://test.%TESTNUMBER:%HTTPPORT/we/want/that/page/%TESTNUMBER
  55. </command>
  56. <features>
  57. proxy
  58. </features>
  59. </client>
  60. #
  61. # Verify data after the test has been "shot"
  62. <verify>
  63. <proxy>
  64. CONNECT test.%TESTNUMBER:%HTTPPORT HTTP/1.1
  65. Host: test.%TESTNUMBER:%HTTPPORT
  66. User-Agent: curl/%VERSION
  67. Proxy-Connection: Keep-Alive
  68. </proxy>
  69. <protocol>
  70. GET /we/want/that/page/%TESTNUMBER HTTP/1.1
  71. Host: test.%TESTNUMBER:%HTTPPORT
  72. User-Agent: curl/%VERSION
  73. Accept: */*
  74. </protocol>
  75. <file name="log/stderr%TESTNUMBER" mode="text">
  76. %if !hyper
  77. * Ignoring Content-Length in CONNECT 200 response
  78. * Ignoring Transfer-Encoding in CONNECT 200 response
  79. %endif
  80. </file>
  81. <stripfile>
  82. s/^.*(?=\* Ignoring (?:Content-Length|Transfer-Encoding) )// or $_ = ''
  83. </stripfile>
  84. </verify>
  85. </testcase>