Skip to content

Commit

Permalink
test case added
Browse files Browse the repository at this point in the history
  • Loading branch information
Niranjan Ojha authored and jcrugzz committed Oct 6, 2016
1 parent 2d01edc commit f5217d6
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/lib-http-proxy-passes-web-outgoing-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit f5217d6

Please sign in to comment.