mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
@@ -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();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user