🐞 fix(subscriptions): negative usage flow

This commit is contained in:
QuentinHsu 2022-10-23 13:36:01 +08:00
parent 06d0c14abc
commit bac04587b8
2 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "sub-store", "name": "sub-store",
"version": "2.13.4", "version": "2.13.5",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js", "main": "src/main.js",
"scripts": { "scripts": {

View File

@ -66,8 +66,12 @@ async function getFlowInfo(req, res) {
} }
// unit is KB // unit is KB
const upload = Number(flowHeaders.match(/upload=(\d+)/)[1]); const uploadMatch = flowHeaders.match(/upload=(-?)(\d+)/)
const download = Number(flowHeaders.match(/download=(\d+)/)[1]); const upload = Number(uploadMatch[1] + uploadMatch[2]);
const downloadMatch = flowHeaders.match(/download=(-?)(\d+)/)
const download = Number(downloadMatch[1] + downloadMatch[2]);
const total = Number(flowHeaders.match(/total=(\d+)/)[1]); const total = Number(flowHeaders.match(/total=(\d+)/)[1]);
// optional expire timestamp // optional expire timestamp