diff --git a/lib/routes/caixin/utils-fulltext.ts b/lib/routes/caixin/utils-fulltext.ts index dd41e12a36eece..1a8289049dda18 100644 --- a/lib/routes/caixin/utils-fulltext.ts +++ b/lib/routes/caixin/utils-fulltext.ts @@ -12,6 +12,10 @@ export async function getFulltext(url: string) { if (!config.caixin.cookie) { return; } + if (!/(\d+)\.html/.test(url)) { + return; + } + const articleID = url.match(/(\d+)\.html/)[1]; const nonce = crypto.randomUUID().replaceAll('-', '').toUpperCase(); @@ -20,7 +24,6 @@ export async function getFulltext(url: string) { .find((e) => e.includes('SA_USER_UID')) ?.split('=')[1]; // - const articleID = url.match(/(\d+)\.html/)[1]; const rawString = `id=${articleID}&uid=${userID}&${nonce}=nonce`; const sig = new KJUR.crypto.Signature({ alg: 'SHA256withRSA' });