2015-05-19 13:00:06 +02:00
|
|
|
'use strict';
|
2016-07-15 15:43:24 -04:00
|
|
|
const common = require('../common');
|
2016-12-30 18:38:06 -05:00
|
|
|
const http = require('http');
|
|
|
|
const assert = require('assert');
|
2011-11-03 01:20:54 +01:00
|
|
|
|
2017-02-03 14:54:19 -05:00
|
|
|
const server = http.createServer(common.mustNotCall());
|
2011-11-03 01:20:54 +01:00
|
|
|
|
2016-05-29 03:06:56 -04:00
|
|
|
server.listen(0, function() {
|
2017-01-08 13:19:00 +00:00
|
|
|
const req = http.request({
|
2016-05-29 03:06:56 -04:00
|
|
|
method: 'GET',
|
|
|
|
host: '127.0.0.1',
|
|
|
|
port: this.address().port
|
|
|
|
});
|
2011-11-03 01:20:54 +01:00
|
|
|
|
|
|
|
req.on('error', function(ex) {
|
|
|
|
// https://github.com/joyent/node/issues/1399#issuecomment-2597359
|
|
|
|
// abort() should emit an Error, not the net.Socket object
|
|
|
|
assert(ex instanceof Error);
|
|
|
|
});
|
|
|
|
|
|
|
|
req.abort();
|
|
|
|
req.end();
|
|
|
|
|
|
|
|
server.close();
|
|
|
|
});
|