From 4977c4ac437305a11fa39d127b168aa02c44f856 Mon Sep 17 00:00:00 2001 From: xream Date: Sun, 20 Jul 2025 13:07:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BB=9F=E4=B8=80=E5=93=8D=E5=BA=94;?= =?UTF-8?q?=20=E5=88=86=E4=BA=AB=E6=8A=A5=E9=94=99=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=98=B2=E6=AD=A2=E5=8E=9F=E5=A7=8B=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=B3=84=E9=9C=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/restful/index.js | 2 +- backend/src/restful/response.js | 4 +++- backend/src/vendor/express.js | 3 +++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/backend/package.json b/backend/package.json index 37ec738..2edc3e7 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.19.90", + "version": "2.19.91", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/restful/index.js b/backend/src/restful/index.js index 7ad7ea3..461e525 100644 --- a/backend/src/restful/index.js +++ b/backend/src/restful/index.js @@ -97,7 +97,7 @@ export default function serve() { staticFileMiddleware(req, res, next); return; } - res.status(403).end('Forbbiden'); + res.status(404).end(); return; }); } diff --git a/backend/src/restful/response.js b/backend/src/restful/response.js index 4ded891..fee9c03 100644 --- a/backend/src/restful/response.js +++ b/backend/src/restful/response.js @@ -12,7 +12,9 @@ export function failed(resp, error, statusCode) { code: error.code, type: error.type, message: error.message, - details: error.details, + details: resp.req?.route?.path?.startsWith('/share/') + ? '详情请查看日志' + : error.details, }, }); } diff --git a/backend/src/vendor/express.js b/backend/src/vendor/express.js index fa7b99b..c931d2b 100644 --- a/backend/src/vendor/express.js +++ b/backend/src/vendor/express.js @@ -36,6 +36,9 @@ export default function express({ substore: $, port, host }) { // adapter app.start = () => { + app.get('*', function (req, res) { + res.status(404).end(); + }); const listener = app.listen(port, host, () => { const { address, port } = listener.address(); $.info(`[BACKEND] listening on ${address}:${port}`);