test case added

This commit is contained in:
Niranjan Ojha 2016-10-06 12:32:30 +05:30 committed by Jarrett Cruger
parent 2d01edc5a5
commit f5217d6c20

View File

@ -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 () {