forked from svrjs/svrjs
Be case insensitive in header name exclusion in shimmed HTTP/1.x res.setHeader method
This commit is contained in:
parent
382d496934
commit
8ac546ff67
1 changed files with 4 additions and 3 deletions
7
svr.js
7
svr.js
|
@ -2922,6 +2922,7 @@ if (!cluster.isPrimary) {
|
||||||
// Set HTTP/1.x methods (to prevent process warnings)
|
// Set HTTP/1.x methods (to prevent process warnings)
|
||||||
res.writeHeadNodeApi = res.writeHead;
|
res.writeHeadNodeApi = res.writeHead;
|
||||||
res.setHeaderNodeApi = res.setHeader;
|
res.setHeaderNodeApi = res.setHeader;
|
||||||
|
|
||||||
res.writeHead = function (a, b, c) {
|
res.writeHead = function (a, b, c) {
|
||||||
var table = c;
|
var table = c;
|
||||||
if (typeof (b) == "object") table = b;
|
if (typeof (b) == "object") table = b;
|
||||||
|
@ -2940,9 +2941,9 @@ if (!cluster.isPrimary) {
|
||||||
return res.writeHeadNodeApi(a, table);
|
return res.writeHeadNodeApi(a, table);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
res.setHeader = function (headerName, headerValue) {
|
||||||
res.setHeader = function (a, b) {
|
var al = headerName.toLowerCase();
|
||||||
if (a != "transfer-encoding" && a != "connection" && a != "keep-alive" && a != "upgrade") return res.setHeaderNodeApi(a, b);
|
if (al != "transfer-encoding" && al != "connection" && al != "keep-alive" && al != "upgrade") return res.setHeaderNodeApi(headerName, headerValue);
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Reference in a new issue