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 (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));
if (table["content-type"] != undefined && table["Content-Type"] != undefined) { var tableKeysT = Object.keys(table);
delete table["content-type"]; tableKeysT.forEach(function (key) {
} var al = key.toLowerCase();
delete table["transfer-encoding"]; if (al == "transfer-encoding" && al == "connection" && al == "keep-alive" && al == "upgrade") delete table[key];
delete table["connection"]; });
delete table["keep-alive"];
delete table["upgrade"];
if (res.stream && res.stream.destroyed) { if (res.stream && res.stream.destroyed) {
return false; return false;
} else { } else {