Skip to content

Commit

Permalink
🐞 fix(subscriptions): negative usage flow (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinHsu committed Oct 24, 2022
1 parent 06d0c14 commit 5de35c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.13.4",
"version": "2.13.5",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {
Expand Down
8 changes: 6 additions & 2 deletions backend/src/restful/subscriptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ async function getFlowInfo(req, res) {
}

// unit is KB
const upload = Number(flowHeaders.match(/upload=(\d+)/)[1]);
const download = Number(flowHeaders.match(/download=(\d+)/)[1]);
const uploadMatch = flowHeaders.match(/upload=(-?)(\d+)/)
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]);

// optional expire timestamp
Expand Down

0 comments on commit 5de35c7

Please sign in to comment.