mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
71abfa9548
* Add `no-useless-concat: error` to .eslintrc.yaml. * Apply no-useless-concat rule to tests. PR-URL: https://github.com/nodejs/node/pull/12613 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
20 lines
602 B
JavaScript
20 lines
602 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();
|
|
}));
|