mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2026-11-28 23:40:30 +00:00
feat: 使用远程链接的响应内容作为订阅流量信息时, 先简单用状态码排除一下错误响应防止缓存
This commit is contained in:
2 files changed
+5
-2
No files matched your search
@@ -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": {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user