aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-http-flush.js
blob: e8f5782c2f78578953cc2c4e5f81cfc930f0a2c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
'use strict';
require('../common');
const http = require('http');

http.createServer(function(req, res) {
  res.end('ok');
  this.close();
}).listen(0, '127.0.0.1', function() {
  const req = http.request({
    method: 'POST',
    host: '127.0.0.1',
    port: this.address().port,
  });
  req.flush();  // Flush the request headers.
  req.flush();  // Should be idempotent.
});