Skip to content

Commit

Permalink
fixed issue with no host header set
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejholly committed Oct 2, 2014
1 parent 02d8139 commit fa43b5f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
@@ -1,4 +1,4 @@
version = $(npm version)
version = $(shell cat package.json | jq -r '.version')
image = longshoreman/longshoreman:$(version)

all: build push
Expand Down
6 changes: 5 additions & 1 deletion index.js
Expand Up @@ -14,7 +14,11 @@ var PORT = process.env.PORT || 3000;
var app = express();

app.use(function(req, res, next) {
var hostname = req.get('host').split(':')[0];
var host = req.get('host');
if (!host) {
return res.status(400).send('No host header');
}
var hostname = host.split(':')[0];
if (process.env.CONTROLLER_HOST == hostname) {
controller(req, res, next);
} else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,5 +1,5 @@
{
"name": "docker-deploy",
"name": "longshoreman",
"version": "0.9.1",
"description": "Deploy Docker containers in the clouds",
"main": "index.js",
Expand Down

0 comments on commit fa43b5f

Please sign in to comment.