Skip to content

Commit d6f18a3

Browse files
committed
feat: 使用远程链接的响应内容作为订阅流量信息时, 先简单用状态码排除一下错误响应防止缓存
1 parent 4cbb0f6 commit d6f18a3

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sub-store",
3-
"version": "2.20.29",
3+
"version": "2.20.30",
44
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
55
"main": "src/main.js",
66
"scripts": {

backend/src/utils/flow.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export async function getFlowHeaders(
8080
userAgent || ''
8181
}, Insecure: ${!!insecure}, Proxy: ${proxy}`,
8282
);
83-
const { body } = await http.get({
83+
const { body, statusCode } = await http.get({
8484
url: flowUrl,
8585
headers: {
8686
'User-Agent': userAgent,
@@ -92,6 +92,9 @@ export async function getFlowHeaders(
9292
...(proxy ? getPolicyDescriptor(proxy) : {}),
9393
...(insecure ? insecure : {}),
9494
});
95+
if (statusCode < 200 || statusCode >= 400) {
96+
throw new Error(`statusCode: ${statusCode}`);
97+
}
9598
flowInfo = body;
9699
} else {
97100
try {

0 commit comments

Comments
 (0)