Permalink
Browse files

Fix bug in vhost middleware

  • Loading branch information...
1 parent d543c8c commit 33068f9e6b75e17a56f82fb22ffaa3f87959cd7c @creationix committed Dec 13, 2011
Showing with 5 additions and 2 deletions.
  1. +1 −1 package.json
  2. +4 −1 vhost.js
View
@@ -2,7 +2,7 @@
"name": "creationix",
"description": "Creationix is a meta package for my personal packages",
"tags": ["stack", "creationix", "meta", "sandbox"],
- "version": "0.2.3",
+ "version": "0.2.4",
"author": "Tim Caswell <tim@creationix.com>",
"repository": {
"type": "git",
View
@@ -1,7 +1,10 @@
module.exports = function setup(domain, handler) {
return function handle(req, res, next) {
- if (req.headers.host === domain) {
+ var host = req.headers.host;
+ var i = host.indexOf(":");
+ if (i >= 0) host = host.substr(0, i);
+ if (host === domain) {
handler(req, res, next);
} else {
next();

0 comments on commit 33068f9

Please sign in to comment.