mirror of
https://codeberg.org/teddit/teddit.git
synced 2026-04-18 21:45:06 -04:00
add a config to force https for api permalinks (#285)
This commit is contained in:
@@ -25,7 +25,7 @@ module.exports = function () {
|
||||
if (from === 'redis') json = JSON.parse(json);
|
||||
|
||||
if (api_type === 'rss') {
|
||||
let protocol = config.https_enabled ? 'https' : 'http';
|
||||
let protocol = config.https_enabled || config.api_force_https ? 'https' : 'http';
|
||||
let items = '';
|
||||
for (var i = 0; i < json.data.children.length; i++) {
|
||||
let link = json.data.children[i].data;
|
||||
@@ -149,7 +149,7 @@ module.exports = function () {
|
||||
req.cookies
|
||||
);
|
||||
|
||||
let protocol = config.https_enabled ? 'https' : 'http';
|
||||
let protocol = config.https_enabled || config.api_force_https ? 'https' : 'http';
|
||||
for (var i = 0; i < processed_json.links.length; i++) {
|
||||
let link = processed_json.links[i];
|
||||
let valid_reddit_self_domains = ['reddit.com'];
|
||||
|
||||
@@ -23,7 +23,7 @@ module.exports = function () {
|
||||
let _json = json; // Keep the original json
|
||||
if (from === 'redis') json = JSON.parse(json);
|
||||
|
||||
let protocol = config.https_enabled ? 'https' : 'http';
|
||||
let protocol = config.https_enabled || config.api_force_https ? 'https' : 'http';
|
||||
let link = `${protocol}://${config.domain}/user/${user}`;
|
||||
|
||||
if (api_type === 'rss') {
|
||||
|
||||
Reference in New Issue
Block a user