1
0
Fork 0
forked from svrjs/svrjs

Be case insensitive in header name exclusion in shimmed HTTP/1.x res.writeHead method

This commit is contained in:
Dorian Niemiec 2024-03-09 15:57:30 +01:00
parent 70444f3b48
commit 4a24b9d892

12
svr.js
View file

@ -2927,13 +2927,11 @@ if (!cluster.isPrimary) {
if (typeof (b) == "object") table = b;
if (table == undefined) table = this.tHeaders;
table = JSON.parse(JSON.stringify(table));
if (table["content-type"] != undefined && table["Content-Type"] != undefined) {
delete table["content-type"];
}
delete table["transfer-encoding"];
delete table["connection"];
delete table["keep-alive"];
delete table["upgrade"];
var tableKeysT = Object.keys(table);
tableKeysT.forEach(function (key) {
var al = key.toLowerCase();
if (al == "transfer-encoding" && al == "connection" && al == "keep-alive" && al == "upgrade") delete table[key];
});
if (res.stream && res.stream.destroyed) {
return false;
} else {