From 0082f62d9ccf1ef5b12b3bec4e7dfdd1803647ed Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 21 Jan 2020 22:35:27 +0100 Subject: [PATCH] http: make --insecure-http-parser configurable per-stream or per-server From the issue: > Some servers deviate from HTTP spec enougth that Node.js can't > communicate with them, but "work" when `--insecure-http-parser` > is enabled globally. It would be useful to be able to use this > mode, as a client, only when connecting to known bad servers. This is largely equivalent to https://github.com/nodejs/node/pull/31446 in terms of code changes. Fixes: https://github.com/nodejs/node/issues/31440 Refs: https://github.com/nodejs/node/pull/31446 Backport-PR-URL: https://github.com/nodejs/node/pull/30471 PR-URL: https://github.com/nodejs/node/pull/31448 Reviewed-By: Sam Roberts Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Rich Trott --- doc/api/http.md | 15 ++++ lib/_http_client.js | 11 ++- lib/_http_server.js | 12 ++- .../test-http-insecure-parser-per-stream.js | 82 +++++++++++++++++++ 4 files changed, 118 insertions(+), 2 deletions(-) create mode 100644 test/parallel/test-http-insecure-parser-per-stream.js diff --git a/doc/api/http.md b/doc/api/http.md index 5cac3fa105cd31..115540b1020c6d 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -1830,6 +1830,9 @@ Found'`.