test1158 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP FORMPOST
  6. </keywords>
  7. </info>
  8. # Server-side
  9. <reply>
  10. <data>
  11. HTTP/1.1 200 OK
  12. Date: Thu, 09 Nov 2010 14:49:00 GMT
  13. Server: test-server/fake
  14. Content-Length: 10
  15. blablabla
  16. </data>
  17. </reply>
  18. # Client-side
  19. <client>
  20. <server>
  21. http
  22. </server>
  23. <name>
  24. HTTP RFC1867-type formposting with filename containing '"'
  25. </name>
  26. <command>
  27. http://%HOSTIP:%HTTPPORT/we/want/1158 -F "file=@\"log/test1158\\\".txt\";type=mo/foo;filename=\"test1158\\\".txt\"" -F 'file2=@"log/test1158\".txt"' -F 'file3=@"log/test1158\".txt";type=m/f,"log/test1158\".txt"'
  28. </command>
  29. <precheck>
  30. perl -e "print 'Test requires a system supporting double quotes in file names' if ($^O eq 'msys');"
  31. </precheck>
  32. # We create this file before the command is invoked!
  33. <file name=log/test1158".txt>
  34. foo bar
  35. This is a bar foo
  36. bar
  37. foo
  38. </file>
  39. </client>
  40. # Verify data after the test has been "shot"
  41. <verify>
  42. <strip>
  43. ^(User-Agent:|Content-Type: multipart/form-data;|Content-Type: multipart/mixed; boundary=|-------).*
  44. </strip>
  45. <protocol>
  46. POST /we/want/1158 HTTP/1.1
  47. User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
  48. Host: %HOSTIP:%HTTPPORT
  49. Accept: */*
  50. Content-Length: 954
  51. Content-Type: multipart/form-data; boundary=----------------------------24e78000bd32
  52. ------------------------------24e78000bd32
  53. Content-Disposition: form-data; name="file"; filename="test1158\".txt"
  54. Content-Type: mo/foo
  55. foo bar
  56. This is a bar foo
  57. bar
  58. foo
  59. ------------------------------24e78000bd32
  60. Content-Disposition: form-data; name="file2"; filename="test1158\".txt"
  61. Content-Type: text/plain
  62. foo bar
  63. This is a bar foo
  64. bar
  65. foo
  66. ------------------------------24e78000bd32
  67. Content-Disposition: form-data; name="file3"
  68. Content-Type: multipart/mixed; boundary=----------------------------7f0e85a48b0b
  69. Content-Disposition: attachment; filename="test1158\".txt"
  70. Content-Type: m/f
  71. foo bar
  72. This is a bar foo
  73. bar
  74. foo
  75. Content-Disposition: attachment; filename="test1158\".txt"
  76. Content-Type: text/plain
  77. foo bar
  78. This is a bar foo
  79. bar
  80. foo
  81. ------------------------------24e78000bd32--
  82. </protocol>
  83. </verify>
  84. </testcase>