From 6ff152cc671d05dc3871b348f7737a4cf963182f 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 97631cf5bf6d44..e84b0bb67f18aa 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -1786,6 +1786,9 @@ the request body should be sent. See the [`'checkContinue'`][] event on