diff --git a/test/lib-http-proxy-passes-web-outgoing-test.js b/test/lib-http-proxy-passes-web-outgoing-test.js index f9d947e..c636e20 100644 --- a/test/lib-http-proxy-passes-web-outgoing-test.js +++ b/test/lib-http-proxy-passes-web-outgoing-test.js @@ -191,6 +191,28 @@ describe('lib/http-proxy/passes/web-outgoing.js', function () { expect(proxyRes.headers.connection).to.eql('keep-alive'); }); + it('don`t set connection with 2.0 if exist', function() { + var proxyRes = { headers: {} }; + httpProxy.setConnection({ + httpVersion: '2.0', + headers: { + connection: 'namstey' + } + }, {}, proxyRes); + + expect(proxyRes.headers.connection).to.eql(undefined); + }); + + it('don`t set connection with 2.0 if doesn`t exist', function() { + var proxyRes = { headers: {} }; + httpProxy.setConnection({ + httpVersion: '2.0', + headers: {} + }, {}, proxyRes); + + expect(proxyRes.headers.connection).to.eql(undefined); + }) + }); describe('#writeStatusCode', function () {