mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-28 16:29:02 +01:00
add enable always https
This commit is contained in:
parent
5901b013ee
commit
96cbcc3fc3
1 changed files with 8 additions and 3 deletions
|
@ -96,6 +96,7 @@ this is our config file,you can change stuff here
|
||||||
tubeApi: "https://api.poketube.fun/api/",
|
tubeApi: "https://api.poketube.fun/api/",
|
||||||
invapi: "https://invidious.sethforprivacy.com/api/v1",
|
invapi: "https://invidious.sethforprivacy.com/api/v1",
|
||||||
dislikes: "https://returnyoutubedislikeapi.com/votes?videoId=",
|
dislikes: "https://returnyoutubedislikeapi.com/votes?videoId=",
|
||||||
|
enablealwayshttps: true, //enables always https on the server
|
||||||
t_url: "https://t.poketube.fun/", // def matomo url
|
t_url: "https://t.poketube.fun/", // def matomo url
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -111,8 +112,12 @@ this is our config file,you can change stuff here
|
||||||
});
|
});
|
||||||
|
|
||||||
app.use(function (request, response, next) {
|
app.use(function (request, response, next) {
|
||||||
if (process.env.NODE_ENV != "development" && !request.secure) {
|
if (config.enablealwayshttps == true) {
|
||||||
return response.redirect("https://" + request.headers.host + request.url);
|
if (process.env.NODE_ENV != "development" && !request.secure) {
|
||||||
|
return response.redirect(
|
||||||
|
"https://" + request.headers.host + request.url
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
next();
|
next();
|
||||||
|
|
Loading…
Reference in a new issue