Skip to content

Commit f94cf71

Browse files
committed
feat: 日志增加 body JSON limit
1 parent fa7df51 commit f94cf71

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

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.19.43",
3+
"version": "2.19.44",
44
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
55
"main": "src/main.js",
66
"scripts": {

backend/src/vendor/express.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ export default function express({ substore: $, port, host }) {
1717
const express_ = eval(`require("express")`);
1818
const bodyParser = eval(`require("body-parser")`);
1919
const app = express_();
20+
const limit = eval('process.env.SUB_STORE_BODY_JSON_LIMIT') || '1mb';
21+
$.info(`[BACKEND] body JSON limit: ${limit}`);
2022
app.use(
2123
bodyParser.json({
2224
verify: rawBodySaver,
23-
limit: eval('process.env.SUB_STORE_BODY_JSON_LIMIT') || '1mb',
25+
limit,
2426
}),
2527
);
2628
app.use(
@@ -36,7 +38,7 @@ export default function express({ substore: $, port, host }) {
3638
app.start = () => {
3739
const listener = app.listen(port, host, () => {
3840
const { address, port } = listener.address();
39-
$.info(`[BACKEND] ${address}:${port}`);
41+
$.info(`[BACKEND] listening on ${address}:${port}`);
4042
});
4143
};
4244
return app;

0 commit comments

Comments
 (0)