From efcf0a57d42241bceedf0ef5a65222e6f6692b00 Mon Sep 17 00:00:00 2001 From: Kevin Gisi Date: Thu, 30 Jul 2015 19:27:00 -0400 Subject: [PATCH] Change host check to proxy check --- website/src/middleware.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/src/middleware.js b/website/src/middleware.js index d91e2cde4c..f00b163b3b 100644 --- a/website/src/middleware.js +++ b/website/src/middleware.js @@ -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();