Skip to content

Commit

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

PR-URL: nodejs#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 BridgeAR committed May 30, 2020
1 parent f08174c commit de35c03
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 de35c03

Please sign in to comment.