Skip to content

Commit 28ca1b5

Browse files
committed
add req.host tests
1 parent 6d872e6 commit 28ca1b5

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/req.host.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
var express = require('../')
3+
, request = require('./support/http')
4+
, assert = require('assert');
5+
6+
describe('req', function(){
7+
describe('.host', function(){
8+
it('should return the Host when present', function(done){
9+
var app = express();
10+
11+
app.use(function(req, res){
12+
res.end(req.host);
13+
});
14+
15+
request(app)
16+
.post('/')
17+
.set('Host', 'example.com')
18+
.expect('example.com', done);
19+
})
20+
})
21+
})

0 commit comments

Comments
 (0)