Skip to content

Commit a3d41a9

Browse files
committed
feat: 订阅流量数据兼容无 upload 字段的情况
1 parent dbd1f76 commit a3d41a9

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

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.33",
3+
"version": "2.20.34",
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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ export function parseFlowHeaders(flowHeaders) {
186186
const uploadMatch = flowHeaders.match(
187187
/upload=([-+]?)([0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)/,
188188
);
189-
const upload = Number(uploadMatch[1] + uploadMatch[2]);
189+
const upload =
190+
uploadMatch == null ? 0 : Number(uploadMatch[1] + uploadMatch[2]);
190191

191192
const downloadMatch = flowHeaders.match(
192193
/download=([-+]?)([0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)/,

0 commit comments

Comments
 (0)