diff --git a/backend/package.json b/backend/package.json index 60a7636..e9f78f1 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.19.17", + "version": "2.19.18", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/restful/download.js b/backend/src/restful/download.js index 9028b6e..bea243f 100644 --- a/backend/src/restful/download.js +++ b/backend/src/restful/download.js @@ -111,7 +111,17 @@ async function downloadSubscription(req, res) { proxy, noCache, } = req.query; - let $options = {}; + let $options = { + _req: { + method: req.method, + url: req.url, + path: req.path, + query: req.query, + params: req.params, + headers: req.headers, + body: req.body, + }, + }; if (req.query.$options) { try { // 支持 `#${encodeURIComponent(JSON.stringify({arg1: "1"}))}` @@ -376,7 +386,17 @@ async function downloadCollection(req, res) { noCache, } = req.query; - let $options = {}; + let $options = { + _req: { + method: req.method, + url: req.url, + path: req.path, + query: req.query, + params: req.params, + headers: req.headers, + body: req.body, + }, + }; if (req.query.$options) { try { // 支持 `#${encodeURIComponent(JSON.stringify({arg1: "1"}))}` diff --git a/backend/src/restful/file.js b/backend/src/restful/file.js index 2c207c1..1744f5e 100644 --- a/backend/src/restful/file.js +++ b/backend/src/restful/file.js @@ -52,8 +52,8 @@ function createFile(req, res) { async function getFile(req, res) { let { name } = req.params; name = decodeURIComponent(name); - - $.info(`正在下载文件:${name}`); + const reqUA = req.headers['user-agent'] || req.headers['User-Agent']; + $.info(`正在下载文件:${name}\n请求 User-Agent: ${reqUA}`); let { url, subInfoUrl, @@ -65,7 +65,17 @@ async function getFile(req, res) { proxy, noCache, } = req.query; - let $options = {}; + let $options = { + _req: { + method: req.method, + url: req.url, + path: req.path, + query: req.query, + params: req.params, + headers: req.headers, + body: req.body, + }, + }; if (req.query.$options) { try { // 支持 `#${encodeURIComponent(JSON.stringify({arg1: "1"}))}`