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}`);