From aae0386d9ef87f3fb006d38da9be348a1a8c6574 Mon Sep 17 00:00:00 2001 From: Yufan You Date: Wed, 27 Aug 2025 19:34:39 +0800 Subject: [PATCH] fix(routes/lovelive-anime): correct relative img URL resolving (#19916) This fixes img URL for base url ending with slash (`topics/` or `news/`) --- lib/routes/lovelive-anime/topics.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/routes/lovelive-anime/topics.ts b/lib/routes/lovelive-anime/topics.ts index e7dfa8b34..b783d9979 100644 --- a/lib/routes/lovelive-anime/topics.ts +++ b/lib/routes/lovelive-anime/topics.ts @@ -109,12 +109,11 @@ async function handler(ctx) { const pubDate = timezone(parseDate(item.find('a > p.date').text(), 'YYYY/MM/DD'), +9); const title = item.find('a > p.title').text(); const category = item.find('a > p.category').text(); - const imglink = `${rootUrl}/${ - item - .find('a > img') - .attr('style') - .match(/background-image:url\((.*)\)/)[1] - }`; + const relativeImgLink = item + .find('a > img') + .attr('style') + .match(/background-image:url\((.*)\)/)[1]; + const imglink = new URL(relativeImgLink, baseUrl).href; return { link,