test259 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP FORMPOST
  6. HTTP proxy
  7. HTTP proxy Digest auth
  8. --proxy-anyauth
  9. </keywords>
  10. </info>
  11. # Server-side
  12. <reply>
  13. # The stupid test server doesn't response anything at all until the full
  14. # request has been sent, and then of course the full POST has already been
  15. # sent!
  16. <data>
  17. HTTP/1.1 407 no, tell me who you are first
  18. Date: Thu, 09 Nov 2010 14:49:00 GMT
  19. Server: test-server/fake
  20. Proxy-Authenticate: Digest realm="many secrets", nonce="911"
  21. Content-Length: 0
  22. </data>
  23. <data1000>
  24. HTTP/1.1 200 A OK
  25. Server: Microsoft-IIS/6.0
  26. Content-Type: text/html; charset=iso-8859-1
  27. Content-Length: 3
  28. ok
  29. </data1000>
  30. <datacheck>
  31. HTTP/1.1 407 no, tell me who you are first
  32. Date: Thu, 09 Nov 2010 14:49:00 GMT
  33. Server: test-server/fake
  34. Proxy-Authenticate: Digest realm="many secrets", nonce="911"
  35. Content-Length: 0
  36. HTTP/1.1 200 A OK
  37. Server: Microsoft-IIS/6.0
  38. Content-Type: text/html; charset=iso-8859-1
  39. Content-Length: 3
  40. ok
  41. </datacheck>
  42. </reply>
  43. # Client-side
  44. <client>
  45. <server>
  46. http
  47. </server>
  48. <features>
  49. crypto
  50. </features>
  51. <name>
  52. HTTP POST multipart with Expect: header using proxy anyauth (Digest)
  53. </name>
  54. <command>
  55. -x http://%HOSTIP:%HTTPPORT http://remotehost:54321/we/want/259 -F name=daniel -F tool=curl -F file=@log/test259.txt -U uuuser:pppassword --proxy-anyauth
  56. </command>
  57. # We create this file before the command is invoked!
  58. <file name="log/test259.txt">
  59. foo-
  60. This is a moo-
  61. bar
  62. </file>
  63. </client>
  64. # Verify data after the test has been "shot"
  65. <verify>
  66. <strip>
  67. ^(User-Agent:|Content-Type: multipart/form-data;|------).*
  68. </strip>
  69. <protocol>
  70. POST http://remotehost:54321/we/want/259 HTTP/1.1
  71. User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
  72. Host: remotehost:54321
  73. Pragma: no-cache
  74. Accept: */*
  75. Proxy-Connection: Keep-Alive
  76. Content-Length: 409
  77. Expect: 100-continue
  78. Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce
  79. ------------------------------7c633d5c27ce
  80. Content-Disposition: form-data; name="name"
  81. daniel
  82. ------------------------------7c633d5c27ce
  83. Content-Disposition: form-data; name="tool"
  84. curl
  85. ------------------------------7c633d5c27ce
  86. Content-Disposition: form-data; name="file"; filename="test259.txt"
  87. Content-Type: text/plain
  88. foo-
  89. This is a moo-
  90. bar
  91. ------------------------------7c633d5c27ce--
  92. POST http://remotehost:54321/we/want/259 HTTP/1.1
  93. User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
  94. Proxy-Authorization: Digest username="uuuser", realm="many secrets", nonce="911", uri="/we/want/259", response="b479994d13e60f3aa192a67c5892ddc5"
  95. Host: remotehost:54321
  96. Pragma: no-cache
  97. Accept: */*
  98. Proxy-Connection: Keep-Alive
  99. Content-Length: 409
  100. Expect: 100-continue
  101. Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce
  102. ------------------------------7c633d5c27ce
  103. Content-Disposition: form-data; name="name"
  104. daniel
  105. ------------------------------7c633d5c27ce
  106. Content-Disposition: form-data; name="tool"
  107. curl
  108. ------------------------------7c633d5c27ce
  109. Content-Disposition: form-data; name="file"; filename="test259.txt"
  110. Content-Type: text/plain
  111. foo-
  112. This is a moo-
  113. bar
  114. ------------------------------7c633d5c27ce--
  115. </protocol>
  116. </verify>
  117. </testcase>