feat: 拉取文件时 日志输出 User-Agent; 脚本上下文参数 $options 中新增 _req 字段, 包含请求信息

This commit is contained in:
xream
2025-04-08 12:47:02 +08:00
parent e054b71a62
commit b074f42fdc
4 changed files with 46 additions and 6 deletions

View File

@@ -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"}))}`