hack to handle no hostname for now

If the hostname is not specified then wtf?
This commit is contained in:
Roman Shtylman
2012-06-24 23:05:56 -04:00
parent e0d16ce8a2
commit 9964d73644

View File

@@ -118,6 +118,22 @@ server.on('connection', function(socket) {
for_client = false;
var hostname = req.headers.host;
if (!hostname) {
log.trace('no hostname: %j', req.headers);
// normal processing if not proxy
var res = new ServerResponse(req);
// TODO(shtylman) skip favicon for now, it caused problems
if (req.url === '/favicon.ico') {
return;
}
res.assignSocket(parser.socket);
self.emit('request', req, res);
return;
}
var match = hostname.match(/^([a-z]{4})[.].*/);
if (!match) {