feat: 订阅流量数据兼容无 upload 字段的情况

This commit is contained in:
xream committed 2025-11-05 20:51:27 +08:00
1 parent dbd1f76507
commit a3d41a9c8e
2 files changed
+3 -2

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.20.33",
"version": "2.20.34",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
"main": "src/main.js",
"scripts": {
+2 -1
View File
@@ -186,7 +186,8 @@ export function parseFlowHeaders(flowHeaders) {
const uploadMatch = flowHeaders.match(
/upload=([-+]?)([0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)/,
);
const upload = Number(uploadMatch[1] + uploadMatch[2]);
const upload =
uploadMatch == null ? 0 : Number(uploadMatch[1] + uploadMatch[2]);
const downloadMatch = flowHeaders.match(
/download=([-+]?)([0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)/,