Skip to content

Commit 2d01edc

Browse files
Niranjan Ojhajcrugzz
Niranjan Ojha
authored andcommitted
not setting connection header in case of http2 as it is deprecated
1 parent d0a1588 commit 2d01edc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/http-proxy/passes/web-outgoing.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var redirectRegex = /^201|30(1|2|7|8)$/;
4242
function setConnection(req, res, proxyRes) {
4343
if (req.httpVersion === '1.0') {
4444
proxyRes.headers.connection = req.headers.connection || 'close';
45-
} else if (!proxyRes.headers.connection) {
45+
} else if (req.httpVersion !== '2.0' && !proxyRes.headers.connection) {
4646
proxyRes.headers.connection = req.headers.connection || 'keep-alive';
4747
}
4848
},

0 commit comments

Comments
 (0)