From 3ab0bfdca54327a020e37f2c837a82ac4f0d8a7c Mon Sep 17 00:00:00 2001 From: xream Date: Fri, 7 Mar 2025 13:59:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20Node.js=20=E7=8E=AF=E5=A2=83=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E8=87=AA=E5=AE=9A=E4=B9=89=20JSON=20Body=20limit,=20?= =?UTF-8?q?=E4=BE=8B:=20`SUB=5FSTORE=5FBODY=5FJSON=5FLIMIT=3D10mb`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/vendor/express.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/package.json b/backend/package.json index 4ed68e6..c6bdb40 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.17.5", + "version": "2.17.6", "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 a2c7220..95cd5dc 100644 --- a/backend/src/vendor/express.js +++ b/backend/src/vendor/express.js @@ -17,7 +17,12 @@ export default function express({ substore: $, port, host }) { const express_ = eval(`require("express")`); const bodyParser = eval(`require("body-parser")`); const app = express_(); - app.use(bodyParser.json({ verify: rawBodySaver, limit: '1mb' })); + app.use( + bodyParser.json({ + verify: rawBodySaver, + limit: eval('process.env.SUB_STORE_BODY_JSON_LIMIT') || '1mb', + }), + ); app.use( bodyParser.urlencoded({ verify: rawBodySaver, extended: true }), );