not setting connection header in case of http2 as it is deprecated

This commit is contained in:
Niranjan Ojha 2016-10-05 19:47:22 +05:30 committed by Jarrett Cruger
parent d0a1588639
commit 2d01edc5a5

View File

@ -42,7 +42,7 @@ var redirectRegex = /^201|30(1|2|7|8)$/;
function setConnection(req, res, proxyRes) { function setConnection(req, res, proxyRes) {
if (req.httpVersion === '1.0') { if (req.httpVersion === '1.0') {
proxyRes.headers.connection = req.headers.connection || 'close'; proxyRes.headers.connection = req.headers.connection || 'close';
} else if (!proxyRes.headers.connection) { } else if (req.httpVersion !== '2.0' && !proxyRes.headers.connection) {
proxyRes.headers.connection = req.headers.connection || 'keep-alive'; proxyRes.headers.connection = req.headers.connection || 'keep-alive';
} }
}, },