mirror of
https://github.com/nodejs/node.git
synced 2025-04-30 15:41:06 +00:00

Indentation is off in test-http-server-unconsume-consume.js. The linter isn't complaining, but it probably should be. PR-URL: https://github.com/nodejs/node/pull/11219 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
20 lines
612 B
JavaScript
20 lines
612 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const http = require('http');
|
|
|
|
const testServer = http.createServer(common.mustNotCall());
|
|
testServer.on('connect', common.mustCall((req, socket, head) => {
|
|
socket.write('HTTP/1.1 200 Connection Established' + '\r\n' +
|
|
'Proxy-agent: Node-Proxy' + '\r\n' +
|
|
'\r\n');
|
|
// This shouldn't raise an assertion in StreamBase::Consume.
|
|
testServer.emit('connection', socket);
|
|
testServer.close();
|
|
}));
|
|
testServer.listen(0, common.mustCall(() => {
|
|
http.request({
|
|
port: testServer.address().port,
|
|
method: 'CONNECT'
|
|
}, (res) => {}).end();
|
|
}));
|