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

This commit is contained in:
xream committed 2025-10-12 20:38:54 +08:00
1 parent 4cbb0f6964
commit d6f18a3822
2 files changed
+5 -2

No files matched your search

+1 -1
View File
@@ -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": {
+4 -1
View File
@@ -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 {