diff --git a/backend/package.json b/backend/package.json index a903b2d..0e7a08c 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.333", + "version": "2.14.334", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/core/proxy-utils/index.js b/backend/src/core/proxy-utils/index.js index 099fcfc..91dc9f4 100644 --- a/backend/src/core/proxy-utils/index.js +++ b/backend/src/core/proxy-utils/index.js @@ -83,7 +83,7 @@ async function processFn(proxies, operators = [], targetPlatform, source) { const { mode, content } = item.args; if (mode === 'link') { let noCache; - let url = content; + let url = content || ''; if (url.endsWith('#noCache')) { url = url.replace(/#noCache$/, ''); noCache = true; diff --git a/backend/src/restful/download.js b/backend/src/restful/download.js index c567d65..a7bd067 100644 --- a/backend/src/restful/download.js +++ b/backend/src/restful/download.js @@ -123,10 +123,11 @@ async function downloadSubscription(req, res) { ['localFirst', 'remoteFirst'].includes(sub.mergeSources) ) { try { - url = `${url || sub.url}` - .split(/[\r\n]+/) - .map((i) => i.trim()) - .filter((i) => i.length)?.[0]; + url = + `${url || sub.url}` + .split(/[\r\n]+/) + .map((i) => i.trim()) + .filter((i) => i.length)?.[0] || ''; let $arguments = {}; const rawArgs = url.split('#'); @@ -283,10 +284,11 @@ async function downloadCollection(req, res) { ['localFirst', 'remoteFirst'].includes(sub.mergeSources) ) { try { - let url = `${sub.url}` - .split(/[\r\n]+/) - .map((i) => i.trim()) - .filter((i) => i.length)?.[0]; + let url = + `${sub.url}` + .split(/[\r\n]+/) + .map((i) => i.trim()) + .filter((i) => i.length)?.[0] || ''; let $arguments = {}; const rawArgs = url.split('#'); diff --git a/backend/src/restful/subscriptions.js b/backend/src/restful/subscriptions.js index 0324ee3..0b9fee1 100644 --- a/backend/src/restful/subscriptions.js +++ b/backend/src/restful/subscriptions.js @@ -68,10 +68,11 @@ async function getFlowInfo(req, res) { return; } try { - let url = `${sub.url}` - .split(/[\r\n]+/) - .map((i) => i.trim()) - .filter((i) => i.length)?.[0]; + let url = + `${sub.url}` + .split(/[\r\n]+/) + .map((i) => i.trim()) + .filter((i) => i.length)?.[0] || ''; let $arguments = {}; const rawArgs = url.split('#'); diff --git a/backend/src/utils/download.js b/backend/src/utils/download.js index 771ae0b..e4dfcf6 100644 --- a/backend/src/utils/download.js +++ b/backend/src/utils/download.js @@ -15,7 +15,7 @@ import $ from '@/core/app'; const tasks = new Map(); export default async function download( - rawUrl, + rawUrl = '', ua, timeout, proxy, diff --git a/backend/src/utils/flow.js b/backend/src/utils/flow.js index 18fb8d9..84d53ac 100644 --- a/backend/src/utils/flow.js +++ b/backend/src/utils/flow.js @@ -11,7 +11,7 @@ export function getFlowField(headers) { return headers[subkey]; } export async function getFlowHeaders(rawUrl, ua, timeout, proxy, flowUrl) { - let url = flowUrl || rawUrl; + let url = flowUrl || rawUrl || ''; let $arguments = {}; const rawArgs = url.split('#'); url = url.split('#')[0];