* Test parallel submissions to the same server
()
| 12 | * Test parallel submissions to the same server |
| 13 | */ |
| 14 | function submitForm() { |
| 15 | var form = new FormData(); |
| 16 | |
| 17 | form.append('my_field', 'my_value'); |
| 18 | |
| 19 | form.submit('http://localhost:' + common.port + '/', function (err, res) { |
| 20 | if (err) { |
| 21 | throw err; |
| 22 | } |
| 23 | |
| 24 | assert.strictEqual(res.statusCode, 200); |
| 25 | |
| 26 | /* |
| 27 | * Needed for node-0.10.x because Streams2 |
| 28 | * more info: http://nodejs.org/api/stream.html#stream_compatibility_with_older_node_versions |
| 29 | */ |
| 30 | res.resume(); |
| 31 | |
| 32 | times -= 1; |
| 33 | if (times === 0) { |
| 34 | server.close(); |
| 35 | } |
| 36 | }); |
| 37 | } |
| 38 | |
| 39 | server = http.createServer(function (req, res) { |
| 40 | // no need to have tmp dir here, since no files being uploaded |