mirror of
https://github.com/bitinflow/server.git
synced 2026-03-13 13:35:53 +00:00
hack to handle no hostname for now
If the hostname is not specified then wtf?
This commit is contained in:
16
server.js
16
server.js
@@ -118,6 +118,22 @@ server.on('connection', function(socket) {
|
|||||||
for_client = false;
|
for_client = false;
|
||||||
|
|
||||||
var hostname = req.headers.host;
|
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})[.].*/);
|
var match = hostname.match(/^([a-z]{4})[.].*/);
|
||||||
|
|
||||||
if (!match) {
|
if (!match) {
|
||||||
|
|||||||
Reference in New Issue
Block a user