We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 97b803f commit e96c60eCopy full SHA for e96c60e
test/parallel/test-http-client-abort-response-event.js
@@ -0,0 +1,22 @@
1
+'use strict';
2
+const common = require('../common');
3
+const http = require('http');
4
+const net = require('net');
5
+const server = http.createServer(function(req, res) {
6
+ res.end();
7
+});
8
+
9
+server.listen(0, common.mustCall(function() {
10
+ const req = http.request({
11
+ port: this.address().port
12
+ }, common.mustCall());
13
14
+ req.on('abort', common.mustCall(function() {
15
+ server.close();
16
+ }));
17
18
+ req.end();
19
+ req.abort();
20
21
+ req.emit('response', new http.IncomingMessage(new net.Socket()));
22
+}));
0 commit comments