From edad52e2431093375bbc6f5b2dc6fdcddb4d4f61 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Mon, 20 Jul 2020 21:44:57 -0700 Subject: [PATCH] test: modify tests to support the latest llhttp PR-URL: https://github.com/nodejs-private/node-private/pull/219 Reviewed-by: James M Snell --- test/parallel/test-http-methods.js | 1 + test/parallel/test-http2-client-http1-server.js | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-http-methods.js b/test/parallel/test-http-methods.js index 43541707a43..5bea399a447 100644 --- a/test/parallel/test-http-methods.js +++ b/test/parallel/test-http-methods.js @@ -40,6 +40,7 @@ const methods = [ 'LOCK', 'MKCOL', 'MOVE', + 'PRI', 'PROPFIND', 'PROPPATCH', 'SEARCH', diff --git a/test/parallel/test-http2-client-http1-server.js b/test/parallel/test-http2-client-http1-server.js index d570f5cbe83..a6052bff841 100644 --- a/test/parallel/test-http2-client-http1-server.js +++ b/test/parallel/test-http2-client-http1-server.js @@ -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}`);