From c204d14cd0920d0b89cad953025ac4c0f4bbf65e 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 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 | 11 ++- .../test-http-insecure-parser-per-stream.js | 82 +++++++++++++++++++ 4 files changed, 117 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 237119a9680ccc..0aee0480183039 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -2023,6 +2023,9 @@ Found'`.