test: modify tests to support the latest llhttp

PR-URL: https://github.com/nodejs-private/node-private/pull/219
Reviewed-by: James M Snell <jasnell@gmail.com>
This commit is contained in:
Fedor Indutny authored and Michaël Zasso committed 2020-09-14 08:33:28 +02:00
1 parent 65415049af
commit edad52e243
2 files changed
+8 -1

No files matched your search

+1
View File
@@ -40,6 +40,7 @@ const methods = [
'LOCK',
'MKCOL',
'MOVE',
'PRI',
'PROPFIND',
'PROPPATCH',
'SEARCH',
@@ -5,12 +5,18 @@ const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
const assert = require('assert');
const http = require('http');
const http2 = require('http2');
const { NghttpError } = require('internal/http2/util');
// Creating an http1 server here...
const server = http.createServer(common.mustNotCall());
// NOTE: PRI method is supported by our HTTP parser - thus the response handling
// function must be called once before error.
const server = http.createServer(common.mustCall((req, res) => {
assert.strictEqual(req.method, 'PRI');
res.end();
}));
server.listen(0, common.mustCall(() => {
const client = http2.connect(`http://localhost:${server.address().port}`);