mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Added possible crash-fix for subdomain-redirecting
This commit is contained in:
@@ -122,6 +122,7 @@ function onListen() {
|
||||
function routingFunction(req, res, next) {
|
||||
var client = require('./apps/client.js');
|
||||
var admin = require('./apps/admin.js');
|
||||
try {
|
||||
var url = req.headers['x-forwarded-host'] ? req.headers['x-forwarded-host'] : req.headers.host.split(":")[0];
|
||||
var subdomain = req.headers['x-forwarded-host'] ? req.headers['x-forwarded-host'].split(".") : req.headers.host.split(":")[0].split(".");
|
||||
|
||||
@@ -130,4 +131,7 @@ function routingFunction(req, res, next) {
|
||||
} else {
|
||||
client(req, res, next);
|
||||
}
|
||||
} catch(e) {
|
||||
res.sendStatus(500);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user