From d6f18a3822fc8f46077417ae8a60fa2da9f3bba6 Mon Sep 17 00:00:00 2001 From: xream Date: Sun, 12 Oct 2025 20:38:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BD=BF=E7=94=A8=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E7=9A=84=E5=93=8D=E5=BA=94=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E4=BD=9C=E4=B8=BA=E8=AE=A2=E9=98=85=E6=B5=81=E9=87=8F=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=97=B6,=20=E5=85=88=E7=AE=80=E5=8D=95=E7=94=A8?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=A0=81=E6=8E=92=E9=99=A4=E4=B8=80=E4=B8=8B?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E5=93=8D=E5=BA=94=E9=98=B2=E6=AD=A2=E7=BC=93?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/utils/flow.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/package.json b/backend/package.json index 65cd9895..ad031ddc 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.20.29", + "version": "2.20.30", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/utils/flow.js b/backend/src/utils/flow.js index a5a22195..4e5daa45 100644 --- a/backend/src/utils/flow.js +++ b/backend/src/utils/flow.js @@ -80,7 +80,7 @@ export async function getFlowHeaders( userAgent || '' }, Insecure: ${!!insecure}, Proxy: ${proxy}`, ); - const { body } = await http.get({ + const { body, statusCode } = await http.get({ url: flowUrl, headers: { 'User-Agent': userAgent, @@ -92,6 +92,9 @@ export async function getFlowHeaders( ...(proxy ? getPolicyDescriptor(proxy) : {}), ...(insecure ? insecure : {}), }); + if (statusCode < 200 || statusCode >= 400) { + throw new Error(`statusCode: ${statusCode}`); + } flowInfo = body; } else { try {