test259 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. Accept: */*
  74. Proxy-Connection: Keep-Alive
  75. Content-Length: 409
  76. Expect: 100-continue
  77. Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce
  78. ------------------------------7c633d5c27ce
  79. Content-Disposition: form-data; name="name"
  80. daniel
  81. ------------------------------7c633d5c27ce
  82. Content-Disposition: form-data; name="tool"
  83. curl
  84. ------------------------------7c633d5c27ce
  85. Content-Disposition: form-data; name="file"; filename="test259.txt"
  86. Content-Type: text/plain
  87. foo-
  88. This is a moo-
  89. bar
  90. ------------------------------7c633d5c27ce--
  91. POST http://remotehost:54321/we/want/259 HTTP/1.1
  92. User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
  93. Proxy-Authorization: Digest username="uuuser", realm="many secrets", nonce="911", uri="/we/want/259", response="b479994d13e60f3aa192a67c5892ddc5"
  94. Host: remotehost:54321
  95. Accept: */*
  96. Proxy-Connection: Keep-Alive
  97. Content-Length: 409
  98. Expect: 100-continue
  99. Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce
  100. ------------------------------7c633d5c27ce
  101. Content-Disposition: form-data; name="name"
  102. daniel
  103. ------------------------------7c633d5c27ce
  104. Content-Disposition: form-data; name="tool"
  105. curl
  106. ------------------------------7c633d5c27ce
  107. Content-Disposition: form-data; name="file"; filename="test259.txt"
  108. Content-Type: text/plain
  109. foo-
  110. This is a moo-
  111. bar
  112. ------------------------------7c633d5c27ce--
  113. </protocol>
  114. </verify>
  115. </testcase>