From 47ad7006e98856908c2cce5101fa111667718f87 Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Tue, 27 Aug 2024 22:44:21 +0200 Subject: [PATCH] Replace the iteration with object spread operator --- src/handlers/requestHandler.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/handlers/requestHandler.js b/src/handlers/requestHandler.js index 6b8ed30..e947d80 100644 --- a/src/handlers/requestHandler.js +++ b/src/handlers/requestHandler.js @@ -54,12 +54,7 @@ function requestHandler(req, res) { return true; } }); - if (vhostP && vhostP.headers) { - const phNu = Object.assign({}, vhostP.headers); - Object.keys(phNu).forEach((phNuK) => { - ph[phNuK] = phNu[phNuK]; - }); - } + if (vhostP && vhostP.headers) ph = {...ph, ...vhostP.headers}; } Object.keys(ph).forEach((phk) => { if (typeof ph[phk] == "string")