From 0b832b38d2833bdcbd593f82eba0239b6d2fe19d Mon Sep 17 00:00:00 2001 From: Fatpandac <1779196284@qq.com> Date: Thu, 17 Feb 2022 00:30:39 +0800 Subject: [PATCH] fix(route): beijing/kw handling external links (#9123) --- lib/v2/gov/beijing/kw/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/v2/gov/beijing/kw/index.js b/lib/v2/gov/beijing/kw/index.js index f6bb0143b..935e31066 100644 --- a/lib/v2/gov/beijing/kw/index.js +++ b/lib/v2/gov/beijing/kw/index.js @@ -19,7 +19,7 @@ module.exports = async (ctx) => { const result = item.match(/urls\[i]='(.*?)';headers\[i]="(.*?)";year\[i]='(\d+)';month\[i]='(\d+)';day\[i]='(\d+)';/); return { title: cheerio.load(result[2])('a').attr('title') || result[2], - link: `${rootUrl}${result[1]}`, + link: new URL(result[1], rootUrl).href, pubDate: parseDate(`${result[3]}-${result[4]}-${result[5]}`, 'YYYY-MM-DD'), }; });