From 324866de072053bf2ed3bae81172f350c0827702 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 21 Jan 2020 22:35:27 +0100 Subject: [PATCH 1/4] 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 --- doc/api/http.md | 14 ++++ lib/_http_client.js | 11 ++- lib/_http_server.js | 11 ++- .../test-http-insecure-parser-per-stream.js | 82 +++++++++++++++++++ 4 files changed, 116 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 14b900ac55f035..bd6d6ed2323862 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -2031,6 +2031,9 @@ Found'`.