Skip to content

Commit 61c2674

Browse files
committed
Add second test for arbitrary default header
1 parent dcd861c commit 61c2674

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/request.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,20 @@ describe('request', function () {
176176
});
177177

178178
it('agent can be used to set default headers', function (done){
179+
var agent = request.agent('https://httpbin.org');
180+
agent.set("Header-Name", "header_value");
181+
182+
agent
183+
.get('/headers')
184+
.then(function (res){
185+
res.should.have.status(200);
186+
res.body.headers.should.have.property('Header-Name').that.equals("header_value");
187+
agent.close();
188+
})
189+
.then(done, done);
190+
});
191+
192+
it('agent can be used to set default basic authentication', function (done){
179193
var agent = request.agent('https://httpbin.org');
180194
agent.auth("user", "passwd");
181195

0 commit comments

Comments
 (0)