* Test submission to HTTPS endpoint
()
| 11 | * Test submission to HTTPS endpoint |
| 12 | */ |
| 13 | function submitForm() { |
| 14 | var form = new FormData(); |
| 15 | |
| 16 | form.append('field', 'value'); |
| 17 | |
| 18 | form.submit({ |
| 19 | protocol: 'https:', |
| 20 | hostname: 'localhost', |
| 21 | port: common.httpsPort, |
| 22 | pathname: '/', |
| 23 | // for self-signed certs on localhost |
| 24 | secureOptions: constants.SSL_OP_NO_TLSv1_2, |
| 25 | ca: common.httpsServerCert |
| 26 | }, function (err, res) { |
| 27 | if (err) { |
| 28 | throw err; |
| 29 | } |
| 30 | |
| 31 | assert.strictEqual(res.statusCode, 200); |
| 32 | assert.strictEqual(res.headers['x-success'], 'OK'); |
| 33 | |
| 34 | // unstuck new streams |
| 35 | res.resume(); |
| 36 | |
| 37 | server.close(); |
| 38 | }); |
| 39 | } |
| 40 | |
| 41 | // create https server |
| 42 | server = https.createServer({ |
nothing calls this directly
no outgoing calls
no test coverage detected