diff --git a/backend/package.json b/backend/package.json index 790cfbc..f1587d3 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.385", + "version": "2.14.386", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/restful/file.js b/backend/src/restful/file.js index 13dd404..ff879f1 100644 --- a/backend/src/restful/file.js +++ b/backend/src/restful/file.js @@ -141,7 +141,14 @@ async function getFile(req, res) { )}`, ); } - + if (file.download) { + res.set( + 'Content-Disposition', + `attachment; filename*=UTF-8''${encodeURIComponent( + file.displayName || file.name, + )}`, + ); + } res.set('Content-Type', 'text/plain; charset=utf-8').send( output ?? '', );