Merge pull request #5864 from gisikw/develop

Fixed the wrong redirect
This commit is contained in:
Kevin Gisi
2015-08-31 17:59:54 -04:00

View File

@@ -21,7 +21,7 @@ function isProxied(req) {
module.exports.forceSSL = function(req, res, next){ module.exports.forceSSL = function(req, res, next){
if(isHTTP(req) && !isProxied(req)) { if(isHTTP(req) && !isProxied(req)) {
return res.redirect(301, BASE_URL + req.url); return res.redirect(BASE_URL + req.url);
} }
next(); next();
@@ -35,7 +35,7 @@ function nonApiUrl(req) {
module.exports.forceHabitica = function(req, res, next) { module.exports.forceHabitica = function(req, res, next) {
if (IS_PROD && !ignoreRedirect && !isProxied(req) && nonApiUrl(req)) { if (IS_PROD && !ignoreRedirect && !isProxied(req) && nonApiUrl(req)) {
return res.redirect(BASE_URL + req.url); return res.redirect(301, BASE_URL + req.url);
} }
next(); next();
}; };