aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-http-server-delete-parser.js
blob: 4215ee2f9df74e544ac6d84e78cf3f1e7d52a646 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
'use strict';

const common = require('../common');

const http = require('http');

const server = http.createServer(common.mustCall((req, res) => {
  res.writeHead(200, { 'Content-Type': 'text/plain' });
  res.write('okay', common.mustCall(() => {
    delete res.socket.parser;
  }));
  res.end();
}));

server.listen(0, '127.0.0.1', common.mustCall(() => {
  const req = http.request({
    port: server.address().port,
    host: '127.0.0.1',
    method: 'GET',
  });
  req.end();
}));

server.unref();