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;
}
});
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")