Skip to content

Commit

Permalink
Closes hapijs#656
Browse files Browse the repository at this point in the history
  • Loading branch information
Eran Hammer committed Apr 3, 2013
1 parent bae678c commit d996a07
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module.exports = internals.Router = function (server) {
internals.Router.prototype.route = function (request) {

var method = (request.method === 'head' ? 'get' : request.method);
var vhost = (request.raw.req.headers.host && this.vhosts[request.raw.req.headers.host]);
var vhost = (request.raw.req.headers.host && this.vhosts[request.raw.req.headers.host.split(':')[0].trim()]);

var lookup = function (table, verb) {

Expand Down
2 changes: 1 addition & 1 deletion test/integration/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('Router', function () {

it('matches vhost route for route with array of vhosts', function (done) {

server.inject({ method: 'GET', url: '/', headers: { host: 'special2.example.com' } }, function (res) {
server.inject({ method: 'GET', url: '/', headers: { host: 'special2.example.com:8080' } }, function (res) {

expect(res.result).to.equal('special array');
done();
Expand Down

0 comments on commit d996a07

Please sign in to comment.