feat: 下载订阅日志中增加请求的 User-Agent

This commit is contained in:
xream 2024-05-25 18:29:48 +08:00
parent b0a2c709e8
commit e28e2a78fb
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
2 changed files with 11 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "sub-store", "name": "sub-store",
"version": "2.14.314", "version": "2.14.315",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js", "main": "src/main.js",
"scripts": { "scripts": {

View File

@ -55,7 +55,11 @@ async function downloadSubscription(req, res) {
const platform = const platform =
req.query.target || getPlatformFromHeaders(req.headers) || 'JSON'; req.query.target || getPlatformFromHeaders(req.headers) || 'JSON';
$.info(`正在下载订阅:${name}`); $.info(
`正在下载订阅:${name}\n请求 User-Agent: ${
req.headers['user-agent'] || req.headers['User-Agent']
}`,
);
let { let {
url, url,
ua, ua,
@ -228,7 +232,11 @@ async function downloadCollection(req, res) {
const allCols = $.read(COLLECTIONS_KEY); const allCols = $.read(COLLECTIONS_KEY);
const collection = findByName(allCols, name); const collection = findByName(allCols, name);
$.info(`正在下载组合订阅:${name}`); $.info(
`正在下载组合订阅:${name}\n请求 User-Agent: ${
req.headers['user-agent'] || req.headers['User-Agent']
}`,
);
let { let {
ignoreFailedRemoteSub, ignoreFailedRemoteSub,