mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-01 14:57:14 +08:00
fix(route/mastodon): Correct the only_media param (#17531)
This commit is contained in:
@@ -36,7 +36,7 @@ export const route: Route = {
|
||||
async function handler(ctx) {
|
||||
const site = ctx.req.param('site');
|
||||
const account_id = ctx.req.param('account_id');
|
||||
const only_media = ctx.req.param('only_media') ? 'true' : 'false';
|
||||
const only_media = ctx.req.param('only_media') === 'true' ? 'true' : 'false';
|
||||
if (!config.feature.allow_user_supply_unsafe_domain && !utils.allowSiteList.includes(site)) {
|
||||
throw new ConfigNotFoundError(`This RSS is disabled unless 'ALLOW_USER_SUPPLY_UNSAFE_DOMAIN' is set to 'true'.`);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ However, you can still specify these route-specific configurations if you need t
|
||||
|
||||
async function handler(ctx) {
|
||||
const acct = ctx.req.param('acct');
|
||||
const only_media = ctx.req.param('only_media') ? 'true' : 'false';
|
||||
const only_media = ctx.req.param('only_media') === 'true' ? 'true' : 'false';
|
||||
|
||||
const { site, account_id } = await utils.getAccountIdByAcct(acct);
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ export const route: Route = {
|
||||
|
||||
async function handler(ctx) {
|
||||
const site = ctx.req.param('site');
|
||||
const only_media = ctx.req.param('only_media') ? 'true' : 'false';
|
||||
const only_media = ctx.req.param('only_media') === 'true' ? 'true' : 'false';
|
||||
if (!config.feature.allow_user_supply_unsafe_domain && !utils.allowSiteList.includes(site)) {
|
||||
throw new ConfigNotFoundError(`This RSS is disabled unless 'ALLOW_USER_SUPPLY_UNSAFE_DOMAIN' is set to 'true'.`);
|
||||
}
|
||||
@@ -47,7 +47,7 @@ async function handler(ctx) {
|
||||
const list = response.data;
|
||||
|
||||
return {
|
||||
title: `Local Public${ctx.req.param('only_media') ? ' Media' : ''} Timeline on ${site}`,
|
||||
title: `Local Public${ctx.req.param('only_media') === 'true' ? ' Media' : ''} Timeline on ${site}`,
|
||||
link: `https://${site}`,
|
||||
item: utils.parseStatuses(list),
|
||||
};
|
||||
|
||||
@@ -36,7 +36,7 @@ export const route: Route = {
|
||||
|
||||
async function handler(ctx) {
|
||||
const site = ctx.req.param('site');
|
||||
const only_media = ctx.req.param('only_media') ? 'true' : 'false';
|
||||
const only_media = ctx.req.param('only_media') === 'true' ? 'true' : 'false';
|
||||
if (!config.feature.allow_user_supply_unsafe_domain && !utils.allowSiteList.includes(site)) {
|
||||
throw new ConfigNotFoundError(`This RSS is disabled unless 'ALLOW_USER_SUPPLY_UNSAFE_DOMAIN' is set to 'true'.`);
|
||||
}
|
||||
@@ -47,7 +47,7 @@ async function handler(ctx) {
|
||||
const list = response.data;
|
||||
|
||||
return {
|
||||
title: `Federated Public${ctx.req.param('only_media') ? ' Media' : ''} Timeline on ${site}`,
|
||||
title: `Federated Public${ctx.req.param('only_media') === 'true' ? ' Media' : ''} Timeline on ${site}`,
|
||||
link: `https://${site}`,
|
||||
item: utils.parseStatuses(list),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user