vulcan 0.2.5 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (211) hide show
  1. data/README.md +1 -80
  2. data/lib/vulcan/cli.rb +12 -33
  3. data/lib/vulcan/version.rb +1 -1
  4. data/server/bin/make +3 -1
  5. data/server/lib/spawner.js +4 -9
  6. data/server/node_modules/connect-form/node_modules/formidable/Readme.md +2 -13
  7. data/server/node_modules/connect-form/node_modules/formidable/lib/incoming_form.js +7 -19
  8. data/server/node_modules/connect-form/node_modules/formidable/lib/multipart_parser.js +1 -12
  9. data/server/node_modules/connect-form/node_modules/formidable/package.json +1 -1
  10. data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-chrome-13.http +10 -0
  11. data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-chrome-12.http +9 -0
  12. data/server/node_modules/connect-form/node_modules/formidable/test/legacy/simple/test-multipart-parser.js +1 -1
  13. data/server/node_modules/cradle/lib/cradle.js +1 -0
  14. data/server/node_modules/cradle/node_modules/vows/LICENSE +20 -0
  15. data/server/node_modules/cradle/node_modules/vows/Makefile +7 -0
  16. data/server/node_modules/cradle/node_modules/vows/README.md +39 -0
  17. data/server/node_modules/cradle/node_modules/vows/bin/vows +515 -0
  18. data/server/node_modules/cradle/node_modules/vows/lib/assert/error.js +27 -0
  19. data/server/node_modules/cradle/node_modules/vows/lib/assert/macros.js +215 -0
  20. data/server/node_modules/cradle/node_modules/vows/lib/assert/utils.js +77 -0
  21. data/server/node_modules/cradle/node_modules/vows/lib/vows.js +193 -0
  22. data/server/node_modules/cradle/node_modules/vows/lib/vows/console.js +131 -0
  23. data/server/node_modules/cradle/node_modules/vows/lib/vows/context.js +55 -0
  24. data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/file.js +29 -0
  25. data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/fragments/coverage-foot.html +2 -0
  26. data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/fragments/coverage-head.html +61 -0
  27. data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/report-html.js +54 -0
  28. data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/report-json.js +54 -0
  29. data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/report-plain.js +38 -0
  30. data/server/node_modules/cradle/node_modules/vows/lib/vows/extras.js +28 -0
  31. data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/dot-matrix.js +67 -0
  32. data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/json.js +16 -0
  33. data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/silent.js +8 -0
  34. data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/spec.js +44 -0
  35. data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/watch.js +39 -0
  36. data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/xunit.js +90 -0
  37. data/server/node_modules/cradle/node_modules/vows/lib/vows/suite.js +319 -0
  38. data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/LICENSE +20 -0
  39. data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/Makefile +4 -0
  40. data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/README.md +72 -0
  41. data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/lib/eyes.js +233 -0
  42. data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/package.json +14 -0
  43. data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/test/eyes-test.js +55 -0
  44. data/server/node_modules/cradle/node_modules/vows/package.json +14 -0
  45. data/server/node_modules/cradle/node_modules/vows/test/assert-test.js +135 -0
  46. data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/failing.js +18 -0
  47. data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/log.js +18 -0
  48. data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/passing.js +17 -0
  49. data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/stderr.js +18 -0
  50. data/server/node_modules/cradle/node_modules/vows/test/isolate-test.js +140 -0
  51. data/server/node_modules/cradle/node_modules/vows/test/testInherit.js +133 -0
  52. data/server/node_modules/cradle/node_modules/vows/test/vows-error-test.js +51 -0
  53. data/server/node_modules/cradle/node_modules/vows/test/vows-test.js +374 -0
  54. data/server/node_modules/cradle/package.json +3 -3
  55. data/server/node_modules/cradle/test/cache-test.js +7 -6
  56. data/server/node_modules/cradle/test/cradle-test.js +5 -4
  57. data/server/node_modules/cradle/test/response-test.js +6 -5
  58. data/server/node_modules/express/History.md +1 -53
  59. data/server/node_modules/express/Makefile +9 -3
  60. data/server/node_modules/express/Readme.md +1 -3
  61. data/server/node_modules/express/bin/express +66 -65
  62. data/server/node_modules/express/lib/express.js +1 -1
  63. data/server/node_modules/express/lib/request.js +9 -23
  64. data/server/node_modules/express/lib/response.js +2 -3
  65. data/server/node_modules/express/lib/utils.js +0 -13
  66. data/server/node_modules/express/lib/view.js +16 -19
  67. data/server/node_modules/express/lib/view/view.js +1 -2
  68. data/server/node_modules/express/node_modules/connect/lib/connect.js +1 -1
  69. data/server/node_modules/express/node_modules/connect/lib/http.js +0 -2
  70. data/server/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js +31 -135
  71. data/server/node_modules/express/node_modules/connect/lib/middleware/limit.js +1 -5
  72. data/server/node_modules/express/node_modules/connect/lib/middleware/session.js +2 -2
  73. data/server/node_modules/express/node_modules/connect/lib/middleware/static.js +21 -26
  74. data/server/node_modules/express/node_modules/connect/lib/middleware/staticCache.js +38 -91
  75. data/server/node_modules/express/node_modules/connect/lib/middleware/vhost.js +1 -1
  76. data/server/node_modules/express/node_modules/connect/lib/utils.js +4 -11
  77. data/server/node_modules/express/node_modules/connect/package.json +6 -7
  78. data/server/node_modules/express/node_modules/connect/test.js +31 -44
  79. data/server/node_modules/express/node_modules/mime/index.js +1 -0
  80. data/server/node_modules/express/node_modules/mime/mime.js +3 -3
  81. data/server/node_modules/express/node_modules/mime/{types/mime.types → mime.types} +0 -0
  82. data/server/node_modules/express/node_modules/mime/{types/node.types → node.types} +0 -17
  83. data/server/node_modules/express/node_modules/mime/package.json +10 -21
  84. data/server/node_modules/express/node_modules/mime/test.js +3 -2
  85. data/server/node_modules/express/node_modules/qs/History.md +0 -11
  86. data/server/node_modules/express/node_modules/qs/Makefile +3 -1
  87. data/server/node_modules/express/node_modules/qs/Readme.md +4 -2
  88. data/server/node_modules/express/node_modules/qs/lib/querystring.js +74 -100
  89. data/server/node_modules/express/node_modules/qs/package.json +2 -9
  90. data/server/node_modules/express/node_modules/qs/support/expresso/History.md +128 -0
  91. data/server/node_modules/express/node_modules/qs/support/expresso/Makefile +53 -0
  92. data/server/node_modules/express/node_modules/qs/support/expresso/Readme.md +61 -0
  93. data/server/node_modules/express/node_modules/qs/support/expresso/bin/expresso +856 -0
  94. data/server/node_modules/express/node_modules/qs/support/expresso/docs/api.html +1080 -0
  95. data/server/node_modules/express/node_modules/qs/support/expresso/docs/index.html +377 -0
  96. data/server/node_modules/express/node_modules/qs/support/expresso/docs/index.md +290 -0
  97. data/server/node_modules/express/node_modules/qs/support/expresso/docs/layout/foot.html +3 -0
  98. data/server/node_modules/express/node_modules/qs/support/expresso/docs/layout/head.html +42 -0
  99. data/server/node_modules/express/node_modules/qs/support/expresso/lib/bar.js +4 -0
  100. data/server/node_modules/express/node_modules/qs/support/expresso/lib/foo.js +16 -0
  101. data/server/node_modules/express/node_modules/qs/support/expresso/package.json +12 -0
  102. data/server/node_modules/express/node_modules/qs/support/expresso/test/assert.test.js +91 -0
  103. data/server/node_modules/express/node_modules/qs/support/expresso/test/async.test.js +12 -0
  104. data/server/node_modules/express/node_modules/qs/support/expresso/test/bar.test.js +13 -0
  105. data/server/node_modules/express/node_modules/qs/support/expresso/test/foo.test.js +14 -0
  106. data/server/node_modules/express/node_modules/qs/support/expresso/test/http.test.js +146 -0
  107. data/server/node_modules/express/node_modules/qs/support/expresso/test/serial/async.test.js +39 -0
  108. data/server/node_modules/express/node_modules/qs/support/expresso/test/serial/http.test.js +48 -0
  109. data/server/node_modules/express/node_modules/qs/support/should/History.md +22 -0
  110. data/server/node_modules/express/node_modules/qs/support/should/Makefile +6 -0
  111. data/server/node_modules/express/node_modules/qs/support/should/Readme.md +248 -0
  112. data/server/node_modules/express/node_modules/qs/support/should/examples/runner.js +53 -0
  113. data/server/node_modules/express/node_modules/qs/support/should/index.js +2 -0
  114. data/server/node_modules/express/node_modules/qs/support/should/lib/eql.js +91 -0
  115. data/server/node_modules/express/node_modules/qs/support/should/lib/should.js +548 -0
  116. data/server/node_modules/express/node_modules/qs/support/should/package.json +8 -0
  117. data/server/node_modules/express/node_modules/qs/support/should/test/should.test.js +358 -0
  118. data/server/node_modules/express/node_modules/qs/test/{parse.js → parse.test.js} +2 -1
  119. data/server/node_modules/express/node_modules/qs/test/{stringify.js → stringify.test.js} +0 -0
  120. data/server/node_modules/express/package.json +8 -9
  121. data/server/node_modules/node-uuid/README.md +67 -166
  122. data/server/node_modules/node-uuid/package.json +3 -5
  123. data/server/node_modules/node-uuid/{benchmark → test}/benchmark-native.c +0 -0
  124. data/server/node_modules/node-uuid/test/benchmark.js +27 -0
  125. data/server/node_modules/node-uuid/test/test.html +0 -3
  126. data/server/node_modules/node-uuid/test/test.js +57 -214
  127. data/server/node_modules/node-uuid/uuid.js +56 -225
  128. data/server/node_modules/restler/README.md +7 -20
  129. data/server/node_modules/restler/bin/restler +1 -1
  130. data/server/node_modules/restler/lib/multipartform.js +8 -9
  131. data/server/node_modules/restler/lib/restler.js +22 -64
  132. data/server/node_modules/restler/package.json +2 -2
  133. data/server/node_modules/restler/test/restler.js +2 -22
  134. data/server/node_modules/restler/test/test_helper.js +1 -20
  135. data/server/package.json +10 -10
  136. data/server/web.js +7 -30
  137. metadata +96 -89
  138. data/server/node_modules/connect-form/node_modules/formidable/test/fixture/file/plain.txt +0 -1
  139. data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/no-filename/generic.http +0 -13
  140. data/server/node_modules/connect-form/node_modules/formidable/test/fixture/js/no-filename.js +0 -3
  141. data/server/node_modules/express/node_modules/connect/node_modules/formidable/Makefile +0 -14
  142. data/server/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md +0 -286
  143. data/server/node_modules/express/node_modules/connect/node_modules/formidable/TODO +0 -3
  144. data/server/node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js +0 -70
  145. data/server/node_modules/express/node_modules/connect/node_modules/formidable/example/post.js +0 -43
  146. data/server/node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js +0 -48
  147. data/server/node_modules/express/node_modules/connect/node_modules/formidable/index.js +0 -1
  148. data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js +0 -61
  149. data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js +0 -377
  150. data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/index.js +0 -3
  151. data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js +0 -312
  152. data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js +0 -25
  153. data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js +0 -6
  154. data/server/node_modules/express/node_modules/connect/node_modules/formidable/package.json +0 -22
  155. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/common.js +0 -19
  156. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt +0 -1
  157. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt +0 -1
  158. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/no-filename/generic.http +0 -13
  159. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md +0 -3
  160. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-chrome-13.http +0 -26
  161. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-firefox-3.6.http +0 -24
  162. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-safari-5.http +0 -23
  163. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-chrome-12.http +0 -24
  164. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-ie-7.http +0 -22
  165. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-ie-8.http +0 -22
  166. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-safari-5.http +0 -22
  167. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js +0 -3
  168. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js +0 -21
  169. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multi_video.upload +0 -0
  170. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multipart.js +0 -72
  171. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js +0 -89
  172. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js +0 -24
  173. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js +0 -80
  174. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js +0 -104
  175. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js +0 -715
  176. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js +0 -50
  177. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js +0 -45
  178. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js +0 -72
  179. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/run.js +0 -2
  180. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/test-incoming-form.js +0 -63
  181. data/server/node_modules/express/node_modules/connect/node_modules/formidable/tool/record.js +0 -47
  182. data/server/node_modules/express/node_modules/mkdirp/LICENSE +0 -21
  183. data/server/node_modules/express/node_modules/mkdirp/README.markdown +0 -21
  184. data/server/node_modules/express/node_modules/mkdirp/examples/pow.js +0 -6
  185. data/server/node_modules/express/node_modules/mkdirp/examples/pow.js.orig +0 -6
  186. data/server/node_modules/express/node_modules/mkdirp/examples/pow.js.rej +0 -19
  187. data/server/node_modules/express/node_modules/mkdirp/index.js +0 -20
  188. data/server/node_modules/express/node_modules/mkdirp/package.json +0 -23
  189. data/server/node_modules/express/node_modules/mkdirp/test/mkdirp.js +0 -28
  190. data/server/node_modules/express/node_modules/mkdirp/test/race.js +0 -41
  191. data/server/node_modules/express/node_modules/mkdirp/test/rel.js +0 -32
  192. data/server/node_modules/express/node_modules/qs/test/mocha.opts +0 -2
  193. data/server/node_modules/express/testing/foo/app.js +0 -35
  194. data/server/node_modules/express/testing/foo/package.json +0 -9
  195. data/server/node_modules/express/testing/foo/public/stylesheets/style.css +0 -8
  196. data/server/node_modules/express/testing/foo/routes/index.js +0 -10
  197. data/server/node_modules/express/testing/foo/views/index.jade +0 -2
  198. data/server/node_modules/express/testing/foo/views/layout.jade +0 -6
  199. data/server/node_modules/express/testing/index.js +0 -43
  200. data/server/node_modules/express/testing/public/test.txt +0 -2971
  201. data/server/node_modules/express/testing/views/page.html +0 -1
  202. data/server/node_modules/express/testing/views/page.jade +0 -3
  203. data/server/node_modules/express/testing/views/test.md +0 -1
  204. data/server/node_modules/express/testing/views/user/index.jade +0 -1
  205. data/server/node_modules/express/testing/views/user/list.jade +0 -1
  206. data/server/node_modules/node-uuid/benchmark/README.md +0 -53
  207. data/server/node_modules/node-uuid/benchmark/bench.gnu +0 -174
  208. data/server/node_modules/node-uuid/benchmark/bench.sh +0 -34
  209. data/server/node_modules/node-uuid/benchmark/benchmark.js +0 -84
  210. data/server/node_modules/node-uuid/test/benchmark-native +0 -0
  211. data/server/node_modules/node-uuid/test/compare_v1.js +0 -63
@@ -1,24 +0,0 @@
1
- POST /upload HTTP/1.1
2
- Host: localhost:8080
3
- User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.22) Gecko/20110902 Firefox/3.6.22
4
- Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
5
- Accept-Language: en-us,en;q=0.5
6
- Accept-Encoding: gzip,deflate
7
- Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
8
- Keep-Alive: 115
9
- Connection: keep-alive
10
- Referer: http://localhost:8080/
11
- Content-Type: multipart/form-data; boundary=---------------------------9849436581144108930470211272
12
- Content-Length: 438
13
-
14
- -----------------------------9849436581144108930470211272
15
- Content-Disposition: form-data; name="title"
16
-
17
- Weird filename
18
- -----------------------------9849436581144108930470211272
19
- Content-Disposition: form-data; name="upload"; filename=": \ ? % * | " < > . &#9731; ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"
20
- Content-Type: text/plain
21
-
22
- I am a text file with a funky name!
23
-
24
- -----------------------------9849436581144108930470211272--
@@ -1,23 +0,0 @@
1
- POST /upload HTTP/1.1
2
- Host: localhost:8080
3
- Origin: http://localhost:8080
4
- Content-Length: 383
5
- User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1
6
- Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryQJZ1gvhvdgfisJPJ
7
- Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
8
- Referer: http://localhost:8080/
9
- Accept-Language: en-us
10
- Accept-Encoding: gzip, deflate
11
- Connection: keep-alive
12
-
13
- ------WebKitFormBoundaryQJZ1gvhvdgfisJPJ
14
- Content-Disposition: form-data; name="title"
15
-
16
- Weird filename
17
- ------WebKitFormBoundaryQJZ1gvhvdgfisJPJ
18
- Content-Disposition: form-data; name="upload"; filename=": \ ? % * | %22 < > . ? ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"
19
- Content-Type: text/plain
20
-
21
- I am a text file with a funky name!
22
-
23
- ------WebKitFormBoundaryQJZ1gvhvdgfisJPJ--
@@ -1,24 +0,0 @@
1
- POST /upload HTTP/1.1
2
- Host: 192.168.56.1:8080
3
- Connection: keep-alive
4
- Referer: http://192.168.56.1:8080/
5
- Content-Length: 344
6
- Cache-Control: max-age=0
7
- Origin: http://192.168.56.1:8080
8
- User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30
9
- Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryEvqBNplR3ByrwQPa
10
- Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
11
- Accept-Encoding: gzip,deflate,sdch
12
- Accept-Language: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
13
- Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
14
-
15
- ------WebKitFormBoundaryEvqBNplR3ByrwQPa
16
- Content-Disposition: form-data; name="title"
17
-
18
- Weird filename
19
- ------WebKitFormBoundaryEvqBNplR3ByrwQPa
20
- Content-Disposition: form-data; name="upload"; filename=" ? % * | %22 < > . ? ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"
21
- Content-Type: text/plain
22
-
23
-
24
- ------WebKitFormBoundaryEvqBNplR3ByrwQPa--
@@ -1,22 +0,0 @@
1
- POST /upload HTTP/1.1
2
- Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, */*
3
- Referer: http://192.168.56.1:8080/
4
- Accept-Language: de
5
- User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)
6
- Content-Type: multipart/form-data; boundary=---------------------------7db1fe232017c
7
- Accept-Encoding: gzip, deflate
8
- Host: 192.168.56.1:8080
9
- Content-Length: 368
10
- Connection: Keep-Alive
11
- Cache-Control: no-cache
12
-
13
- -----------------------------7db1fe232017c
14
- Content-Disposition: form-data; name="title"
15
-
16
- Weird filename
17
- -----------------------------7db1fe232017c
18
- Content-Disposition: form-data; name="upload"; filename=" ? % * | " < > . &#9731; ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"
19
- Content-Type: application/octet-stream
20
-
21
-
22
- -----------------------------7db1fe232017c--
@@ -1,22 +0,0 @@
1
- POST /upload HTTP/1.1
2
- Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, */*
3
- Referer: http://192.168.56.1:8080/
4
- Accept-Language: de
5
- User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)
6
- Content-Type: multipart/form-data; boundary=---------------------------7db3a8372017c
7
- Accept-Encoding: gzip, deflate
8
- Host: 192.168.56.1:8080
9
- Content-Length: 368
10
- Connection: Keep-Alive
11
- Cache-Control: no-cache
12
-
13
- -----------------------------7db3a8372017c
14
- Content-Disposition: form-data; name="title"
15
-
16
- Weird filename
17
- -----------------------------7db3a8372017c
18
- Content-Disposition: form-data; name="upload"; filename=" ? % * | " < > . &#9731; ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"
19
- Content-Type: application/octet-stream
20
-
21
-
22
- -----------------------------7db3a8372017c--
@@ -1,22 +0,0 @@
1
- POST /upload HTTP/1.1
2
- Host: 192.168.56.1:8080
3
- Referer: http://192.168.56.1:8080/
4
- Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
5
- Accept-Language: en-US
6
- Origin: http://192.168.56.1:8080
7
- User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4
8
- Accept-Encoding: gzip, deflate
9
- Content-Type: multipart/form-data; boundary=----WebKitFormBoundarykmaWSUbu697WN9TM
10
- Content-Length: 344
11
- Connection: keep-alive
12
-
13
- ------WebKitFormBoundarykmaWSUbu697WN9TM
14
- Content-Disposition: form-data; name="title"
15
-
16
- Weird filename
17
- ------WebKitFormBoundarykmaWSUbu697WN9TM
18
- Content-Disposition: form-data; name="upload"; filename=" ? % * | %22 < > . ? ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"
19
- Content-Type: text/plain
20
-
21
-
22
- ------WebKitFormBoundarykmaWSUbu697WN9TM--
@@ -1,3 +0,0 @@
1
- module.exports['generic.http'] = [
2
- {type: 'file', name: 'upload', filename: '', fixture: 'plain.txt'},
3
- ];
@@ -1,21 +0,0 @@
1
- var properFilename = 'funkyfilename.txt';
2
-
3
- function expect(filename) {
4
- return [
5
- {type: 'field', name: 'title', value: 'Weird filename'},
6
- {type: 'file', name: 'upload', filename: filename, fixture: properFilename},
7
- ];
8
- };
9
-
10
- var webkit = " ? % * | \" < > . ? ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt";
11
- var ffOrIe = " ? % * | \" < > . ☃ ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt";
12
-
13
- module.exports = {
14
- 'osx-chrome-13.http' : expect(webkit),
15
- 'osx-firefox-3.6.http' : expect(ffOrIe),
16
- 'osx-safari-5.http' : expect(webkit),
17
- 'xp-chrome-12.http' : expect(webkit),
18
- 'xp-ie-7.http' : expect(ffOrIe),
19
- 'xp-ie-8.http' : expect(ffOrIe),
20
- 'xp-safari-5.http' : expect(webkit),
21
- };
@@ -1,72 +0,0 @@
1
- exports['rfc1867'] =
2
- { boundary: 'AaB03x',
3
- raw:
4
- '--AaB03x\r\n'+
5
- 'content-disposition: form-data; name="field1"\r\n'+
6
- '\r\n'+
7
- 'Joe Blow\r\nalmost tricked you!\r\n'+
8
- '--AaB03x\r\n'+
9
- 'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n'+
10
- 'Content-Type: text/plain\r\n'+
11
- '\r\n'+
12
- '... contents of file1.txt ...\r\r\n'+
13
- '--AaB03x--\r\n',
14
- parts:
15
- [ { headers: {
16
- 'content-disposition': 'form-data; name="field1"',
17
- },
18
- data: 'Joe Blow\r\nalmost tricked you!',
19
- },
20
- { headers: {
21
- 'content-disposition': 'form-data; name="pics"; filename="file1.txt"',
22
- 'Content-Type': 'text/plain',
23
- },
24
- data: '... contents of file1.txt ...\r',
25
- }
26
- ]
27
- };
28
-
29
- exports['noTrailing\r\n'] =
30
- { boundary: 'AaB03x',
31
- raw:
32
- '--AaB03x\r\n'+
33
- 'content-disposition: form-data; name="field1"\r\n'+
34
- '\r\n'+
35
- 'Joe Blow\r\nalmost tricked you!\r\n'+
36
- '--AaB03x\r\n'+
37
- 'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n'+
38
- 'Content-Type: text/plain\r\n'+
39
- '\r\n'+
40
- '... contents of file1.txt ...\r\r\n'+
41
- '--AaB03x--',
42
- parts:
43
- [ { headers: {
44
- 'content-disposition': 'form-data; name="field1"',
45
- },
46
- data: 'Joe Blow\r\nalmost tricked you!',
47
- },
48
- { headers: {
49
- 'content-disposition': 'form-data; name="pics"; filename="file1.txt"',
50
- 'Content-Type': 'text/plain',
51
- },
52
- data: '... contents of file1.txt ...\r',
53
- }
54
- ]
55
- };
56
-
57
- exports['emptyHeader'] =
58
- { boundary: 'AaB03x',
59
- raw:
60
- '--AaB03x\r\n'+
61
- 'content-disposition: form-data; name="field1"\r\n'+
62
- ': foo\r\n'+
63
- '\r\n'+
64
- 'Joe Blow\r\nalmost tricked you!\r\n'+
65
- '--AaB03x\r\n'+
66
- 'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n'+
67
- 'Content-Type: text/plain\r\n'+
68
- '\r\n'+
69
- '... contents of file1.txt ...\r\r\n'+
70
- '--AaB03x--\r\n',
71
- expectError: true,
72
- };
@@ -1,89 +0,0 @@
1
- var hashish = require('hashish');
2
- var fs = require('fs');
3
- var findit = require('findit');
4
- var path = require('path');
5
- var http = require('http');
6
- var net = require('net');
7
- var assert = require('assert');
8
-
9
- var common = require('../common');
10
- var formidable = common.formidable;
11
-
12
- var server = http.createServer();
13
- server.listen(common.port, findFixtures);
14
-
15
- function findFixtures() {
16
- var fixtures = [];
17
- findit
18
- .sync(common.dir.fixture + '/js')
19
- .forEach(function(jsPath) {
20
- if (!/\.js$/.test(jsPath)) return;
21
-
22
- var group = path.basename(jsPath, '.js');
23
- hashish.forEach(require(jsPath), function(fixture, name) {
24
- fixtures.push({
25
- name : group + '/' + name,
26
- fixture : fixture,
27
- });
28
- });
29
- });
30
-
31
- testNext(fixtures);
32
- }
33
-
34
- function testNext(fixtures) {
35
- var fixture = fixtures.shift();
36
- if (!fixture) return server.close();
37
-
38
- var name = fixture.name;
39
- var fixture = fixture.fixture;
40
-
41
- uploadFixture(name, function(err, parts) {
42
- if (err) throw err;
43
-
44
- fixture.forEach(function(expectedPart, i) {
45
- var parsedPart = parts[i];
46
- assert.equal(parsedPart.type, expectedPart.type);
47
- assert.equal(parsedPart.name, expectedPart.name);
48
-
49
- if (parsedPart.type === 'file') {
50
- var filename = parsedPart.value.name;
51
- assert.equal(filename, expectedPart.filename);
52
- }
53
- });
54
-
55
- testNext(fixtures);
56
- });
57
- };
58
-
59
- function uploadFixture(name, cb) {
60
- server.once('request', function(req, res) {
61
- var form = new formidable.IncomingForm();
62
- form.uploadDir = common.dir.tmp;
63
- form.parse(req);
64
-
65
- function callback() {
66
- var realCallback = cb;
67
- cb = function() {};
68
- realCallback.apply(null, arguments);
69
- }
70
-
71
- var parts = [];
72
- form
73
- .on('error', callback)
74
- .on('fileBegin', function(name, value) {
75
- parts.push({type: 'file', name: name, value: value});
76
- })
77
- .on('field', function(name, value) {
78
- parts.push({type: 'field', name: name, value: value});
79
- })
80
- .on('end', function() {
81
- callback(null, parts);
82
- });
83
- });
84
-
85
- var socket = net.createConnection(common.port);
86
- var file = fs.createReadStream(common.dir.fixture + '/http/' + name);
87
-
88
- file.pipe(socket);
89
- }
@@ -1,24 +0,0 @@
1
- var path = require('path'),
2
- fs = require('fs');
3
-
4
- try {
5
- global.Gently = require('gently');
6
- } catch (e) {
7
- throw new Error('this test suite requires node-gently');
8
- }
9
-
10
- exports.lib = path.join(__dirname, '../../lib');
11
-
12
- global.GENTLY = new Gently();
13
-
14
- global.assert = require('assert');
15
- global.TEST_PORT = 13532;
16
- global.TEST_FIXTURES = path.join(__dirname, '../fixture');
17
- global.TEST_TMP = path.join(__dirname, '../tmp');
18
-
19
- // Stupid new feature in node that complains about gently attaching too many
20
- // listeners to process 'exit'. This is a workaround until I can think of a
21
- // better way to deal with this.
22
- if (process.setMaxListeners) {
23
- process.setMaxListeners(10000);
24
- }
@@ -1,80 +0,0 @@
1
- var common = require('../common');
2
- var CHUNK_LENGTH = 10,
3
- multipartParser = require(common.lib + '/multipart_parser'),
4
- MultipartParser = multipartParser.MultipartParser,
5
- parser = new MultipartParser(),
6
- fixtures = require(TEST_FIXTURES + '/multipart'),
7
- Buffer = require('buffer').Buffer;
8
-
9
- Object.keys(fixtures).forEach(function(name) {
10
- var fixture = fixtures[name],
11
- buffer = new Buffer(Buffer.byteLength(fixture.raw, 'binary')),
12
- offset = 0,
13
- chunk,
14
- nparsed,
15
-
16
- parts = [],
17
- part = null,
18
- headerField,
19
- headerValue,
20
- endCalled = '';
21
-
22
- parser.initWithBoundary(fixture.boundary);
23
- parser.onPartBegin = function() {
24
- part = {headers: {}, data: ''};
25
- parts.push(part);
26
- headerField = '';
27
- headerValue = '';
28
- };
29
-
30
- parser.onHeaderField = function(b, start, end) {
31
- headerField += b.toString('ascii', start, end);
32
- };
33
-
34
- parser.onHeaderValue = function(b, start, end) {
35
- headerValue += b.toString('ascii', start, end);
36
- }
37
-
38
- parser.onHeaderEnd = function() {
39
- part.headers[headerField] = headerValue;
40
- headerField = '';
41
- headerValue = '';
42
- };
43
-
44
- parser.onPartData = function(b, start, end) {
45
- var str = b.toString('ascii', start, end);
46
- part.data += b.slice(start, end);
47
- }
48
-
49
- parser.onEnd = function() {
50
- endCalled = true;
51
- }
52
-
53
- buffer.write(fixture.raw, 'binary', 0);
54
-
55
- while (offset < buffer.length) {
56
- if (offset + CHUNK_LENGTH < buffer.length) {
57
- chunk = buffer.slice(offset, offset+CHUNK_LENGTH);
58
- } else {
59
- chunk = buffer.slice(offset, buffer.length);
60
- }
61
- offset = offset + CHUNK_LENGTH;
62
-
63
- nparsed = parser.write(chunk);
64
- if (nparsed != chunk.length) {
65
- if (fixture.expectError) {
66
- return;
67
- }
68
- puts('-- ERROR --');
69
- p(chunk.toString('ascii'));
70
- throw new Error(chunk.length+' bytes written, but only '+nparsed+' bytes parsed!');
71
- }
72
- }
73
-
74
- if (fixture.expectError) {
75
- throw new Error('expected parse error did not happen');
76
- }
77
-
78
- assert.ok(endCalled);
79
- assert.deepEqual(parts, fixture.parts);
80
- });