mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-06-04 11:13:59 +08:00
feat: 日志增加 body JSON limit
This commit is contained in:
parent
fa7df51f8c
commit
f94cf7185a
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.19.43",
|
"version": "2.19.44",
|
||||||
"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": {
|
||||||
|
6
backend/src/vendor/express.js
vendored
6
backend/src/vendor/express.js
vendored
@ -17,10 +17,12 @@ export default function express({ substore: $, port, host }) {
|
|||||||
const express_ = eval(`require("express")`);
|
const express_ = eval(`require("express")`);
|
||||||
const bodyParser = eval(`require("body-parser")`);
|
const bodyParser = eval(`require("body-parser")`);
|
||||||
const app = express_();
|
const app = express_();
|
||||||
|
const limit = eval('process.env.SUB_STORE_BODY_JSON_LIMIT') || '1mb';
|
||||||
|
$.info(`[BACKEND] body JSON limit: ${limit}`);
|
||||||
app.use(
|
app.use(
|
||||||
bodyParser.json({
|
bodyParser.json({
|
||||||
verify: rawBodySaver,
|
verify: rawBodySaver,
|
||||||
limit: eval('process.env.SUB_STORE_BODY_JSON_LIMIT') || '1mb',
|
limit,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
app.use(
|
app.use(
|
||||||
@ -36,7 +38,7 @@ export default function express({ substore: $, port, host }) {
|
|||||||
app.start = () => {
|
app.start = () => {
|
||||||
const listener = app.listen(port, host, () => {
|
const listener = app.listen(port, host, () => {
|
||||||
const { address, port } = listener.address();
|
const { address, port } = listener.address();
|
||||||
$.info(`[BACKEND] ${address}:${port}`);
|
$.info(`[BACKEND] listening on ${address}:${port}`);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
return app;
|
return app;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user