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 (typeof (b) == "object") table = b;
if (table == undefined) table = this.tHeaders; if (table == undefined) table = this.tHeaders;
table = JSON.parse(JSON.stringify(table)); table = JSON.parse(JSON.stringify(table));
var tableKeysT = Object.keys(table); Object.keys(table).forEach(function (key) {
tableKeysT.forEach(function (key) {
var al = key.toLowerCase(); var al = key.toLowerCase();
if (al == "transfer-encoding" || al == "connection" || al == "keep-alive" || al == "upgrade") delete table[key]; if (al == "transfer-encoding" || al == "connection" || al == "keep-alive" || al == "upgrade") delete table[key];
}); });