Skip to content

Commit

Permalink
http2: add type checks for Http2ServerResponse.end
Browse files Browse the repository at this point in the history
Refs: #29829

PR-URL: #33146
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
rexagod authored and codebytere committed Jun 18, 2020
1 parent 8e3a0d7 commit 0b34c4f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/parallel/test-http-outgoing-end-types.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const http = require('http');

const httpServer = http.createServer(common.mustCall(function(req, res) {
httpServer.close();
assert.throws(() => {
res.end(['Throws.']);
}, {
code: 'ERR_INVALID_ARG_TYPE'
});
res.end();
}));

httpServer.listen(0, common.mustCall(function() {
http.get({ port: this.address().port });
}));

0 comments on commit 0b34c4f

Please sign in to comment.