1
0
Fork 0
forked from svrjs/svrjs

Optimize HTTP/1.x compatiblity res.writeHead function

This commit is contained in:
Dorian Niemiec 2024-03-09 16:10:41 +01:00
parent 0e44109776
commit 52e729f51d

3
svr.js
View file

@ -2927,8 +2927,7 @@ if (!cluster.isPrimary) {
if (typeof (b) == "object") table = b;
if (table == undefined) table = this.tHeaders;
table = JSON.parse(JSON.stringify(table));
var tableKeysT = Object.keys(table);
tableKeysT.forEach(function (key) {
Object.keys(table).forEach(function (key) {
var al = key.toLowerCase();
if (al == "transfer-encoding" || al == "connection" || al == "keep-alive" || al == "upgrade") delete table[key];
});