Skip to content

Commit 8def934

Browse files
rexagodcodebytere
authored andcommitted
http2: add type checks for Http2ServerResponse.end
Refs: #29829 PR-URL: #33146 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 7dc28ab commit 8def934

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
'use strict';
2+
const common = require('../common');
3+
const assert = require('assert');
4+
const http = require('http');
5+
6+
const httpServer = http.createServer(common.mustCall(function(req, res) {
7+
httpServer.close();
8+
assert.throws(() => {
9+
res.end(['Throws.']);
10+
}, {
11+
code: 'ERR_INVALID_ARG_TYPE'
12+
});
13+
res.end();
14+
}));
15+
16+
httpServer.listen(0, common.mustCall(function() {
17+
http.get({ port: this.address().port });
18+
}));

0 commit comments

Comments
 (0)