mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
test: add test for HTTP client "aborted" event
PR-URL: https://github.com/nodejs/node/pull/7376 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
1 parent
2c056a40c7
commit
54def06d73
1 file changed
+18
@@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
const common = require('../common');
|
||||
const http = require('http');
|
||||
|
||||
const server = http.Server(function(req, res) {
|
||||
res.write('Part of my res.');
|
||||
res.destroy();
|
||||
});
|
||||
|
||||
server.listen(0, common.mustCall(function() {
|
||||
http.get({
|
||||
port: this.address().port,
|
||||
headers: { connection: 'keep-alive' }
|
||||
}, common.mustCall(function(res) {
|
||||
server.close();
|
||||
res.on('aborted', common.mustCall(function() {}));
|
||||
}));
|
||||
}));
|
||||
Reference in new issue
Block a user