mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
http2: add type checks for Http2ServerResponse.end
Refs: https://github.com/nodejs/node/issues/29829 PR-URL: https://github.com/nodejs/node/pull/33146 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
f08174c9fb
commit
de35c030b5
18
test/parallel/test-http-outgoing-end-types.js
Normal file
18
test/parallel/test-http-outgoing-end-types.js
Normal file
@ -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 });
|
||||
}));
|
Loading…
Reference in New Issue
Block a user