Skip to content

Commit c8e31fa

Browse files
committed
assert the host header.
1 parent 6d265f9 commit c8e31fa

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

test/node/redirects-other-host.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ app.listen(3210);
1414
describe('request', function(){
1515
describe('on redirect', function(){
1616
it('should follow Location even when the host changes', function(done){
17-
request
18-
.get('http://localhost:3210/test')
19-
.redirects(1)
20-
.end(function(res){
21-
res.status.should.eql(200);
22-
done();
23-
});
17+
var req = request
18+
.get('http://localhost:3210/test')
19+
.redirects(1)
20+
.end(function(res){
21+
req.req._headers.host.should.eql('github.com');
22+
res.status.should.eql(200);
23+
done();
24+
});
2425
})
2526
});
2627
});

0 commit comments

Comments
 (0)