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 <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
rexagod authored and codebytere committed Jul 8, 2020
1 parent 7dc28ab commit 8def934
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 8def934

Please sign in to comment.