From f94cf7185a7baf7b094041e356df6b217d92511b Mon Sep 17 00:00:00 2001 From: xream Date: Tue, 20 May 2025 21:16:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=97=A5=E5=BF=97=E5=A2=9E=E5=8A=A0=20?= =?UTF-8?q?body=20JSON=20limit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/vendor/express.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/package.json b/backend/package.json index 3a38a77..dc50bd5 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.19.43", + "version": "2.19.44", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/vendor/express.js b/backend/src/vendor/express.js index 95cd5dc..fa7b99b 100644 --- a/backend/src/vendor/express.js +++ b/backend/src/vendor/express.js @@ -17,10 +17,12 @@ export default function express({ substore: $, port, host }) { const express_ = eval(`require("express")`); const bodyParser = eval(`require("body-parser")`); const app = express_(); + const limit = eval('process.env.SUB_STORE_BODY_JSON_LIMIT') || '1mb'; + $.info(`[BACKEND] body JSON limit: ${limit}`); app.use( bodyParser.json({ verify: rawBodySaver, - limit: eval('process.env.SUB_STORE_BODY_JSON_LIMIT') || '1mb', + limit, }), ); app.use( @@ -36,7 +38,7 @@ export default function express({ substore: $, port, host }) { app.start = () => { const listener = app.listen(port, host, () => { const { address, port } = listener.address(); - $.info(`[BACKEND] ${address}:${port}`); + $.info(`[BACKEND] listening on ${address}:${port}`); }); }; return app;