mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
not setting connection header in case of http2 as it is deprecated
This commit is contained in:
parent
d0a1588639
commit
2d01edc5a5
@ -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';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user