Skip to content

Commit f5217d6

Browse files
Niranjan Ojhajcrugzz
Niranjan Ojha
authored andcommitted
test case added
1 parent 2d01edc commit f5217d6

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

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

+22
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,28 @@ describe('lib/http-proxy/passes/web-outgoing.js', function () {
191191
expect(proxyRes.headers.connection).to.eql('keep-alive');
192192
});
193193

194+
it('don`t set connection with 2.0 if exist', function() {
195+
var proxyRes = { headers: {} };
196+
httpProxy.setConnection({
197+
httpVersion: '2.0',
198+
headers: {
199+
connection: 'namstey'
200+
}
201+
}, {}, proxyRes);
202+
203+
expect(proxyRes.headers.connection).to.eql(undefined);
204+
});
205+
206+
it('don`t set connection with 2.0 if doesn`t exist', function() {
207+
var proxyRes = { headers: {} };
208+
httpProxy.setConnection({
209+
httpVersion: '2.0',
210+
headers: {}
211+
}, {}, proxyRes);
212+
213+
expect(proxyRes.headers.connection).to.eql(undefined);
214+
})
215+
194216
});
195217

196218
describe('#writeStatusCode', function () {

0 commit comments

Comments
 (0)