From d70c0ed250ac79e267e87213c6fa0a6c51a634af Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Sun, 20 Sep 2020 09:32:06 +0200 Subject: [PATCH] http: allow passing array of key/val into writeHead Enables an optimization when the user already has the headers in an array form, e.g. when proxying. PR-URL: https://github.com/nodejs/node/pull/35274 Reviewed-By: Matteo Collina Reviewed-By: Benjamin Gruenbaum Reviewed-By: Rich Trott --- doc/api/http.md | 10 +++- lib/_http_outgoing.js | 15 +++++- lib/_http_server.js | 13 +++++- test/parallel/test-http-write-head-2.js | 61 +++++++++++++++++++++++++ 4 files changed, 95 insertions(+), 4 deletions(-) create mode 100644 test/parallel/test-http-write-head-2.js diff --git a/doc/api/http.md b/doc/api/http.md index a63e0a0c1b2546..ac92b34b30bcef 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -1797,6 +1797,9 @@ the request body should be sent. See the [`'checkContinue'`][] event on