Change host check to proxy check
This commit is contained in:
@@ -124,7 +124,7 @@ function nonApiUrl(req) {
|
||||
}
|
||||
|
||||
module.exports.forceHabitica = function(req, res, next) {
|
||||
if(nconf.get('NODE_ENV') === 'production' && (req.hostname.search('habitica') === -1) && nonApiUrl(req)) {
|
||||
if(nconf.get('NODE_ENV') === 'production' && !isProxied(req) && nonApiUrl(req)) {
|
||||
return res.redirect('https://habitica.com' + req.url);
|
||||
}
|
||||
next();
|
||||
|
||||
Reference in New Issue
Block a user