From b0fadae5079f78525f4763eed913e3880f2f41a7 Mon Sep 17 00:00:00 2001 From: dzx-dzx Date: Wed, 13 Nov 2024 16:06:39 +0800 Subject: [PATCH] . --- lib/routes/caixin/latest.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/routes/caixin/latest.ts b/lib/routes/caixin/latest.ts index b6b23a9b27cb0e..da585b75c2e293 100644 --- a/lib/routes/caixin/latest.ts +++ b/lib/routes/caixin/latest.ts @@ -49,7 +49,12 @@ async function handler(ctx) { // desc const desc = await parseArticle(item); - item.description = ctx.req.query('fulltext') === 'true' ? ((await getFulltext(item.link)) ?? desc.description) : desc.description; + if (ctx.req.query('fulltext') === 'true') { + const authorizedFullText = await getFulltext(item.link); + item.description = authorizedFullText === '' ? desc.description : authorizedFullText; + } else { + item.description = desc.description; + } // prevent cache coliision with /caixin/article and /caixin/:column/:category // since those have podcasts item.guid = `caixin:latest:${item.link}`;