Replace the iteration with object spread operator

This commit is contained in:
Dorian Niemiec 2024-08-27 22:44:21 +02:00
parent 4506d38eac
commit 47ad7006e9

View file

@ -54,12 +54,7 @@ function requestHandler(req, res) {
return true; return true;
} }
}); });
if (vhostP && vhostP.headers) { if (vhostP && vhostP.headers) ph = {...ph, ...vhostP.headers};
const phNu = Object.assign({}, vhostP.headers);
Object.keys(phNu).forEach((phNuK) => {
ph[phNuK] = phNu[phNuK];
});
}
} }
Object.keys(ph).forEach((phk) => { Object.keys(ph).forEach((phk) => {
if (typeof ph[phk] == "string") if (typeof ph[phk] == "string")