Skip to content

Commit

Permalink
feat: 下载订阅日志中增加请求的 User-Agent
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed May 25, 2024
1 parent b0a2c70 commit e28e2a7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.14.314",
"version": "2.14.315",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {
Expand Down
12 changes: 10 additions & 2 deletions backend/src/restful/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ async function downloadSubscription(req, res) {
const platform =
req.query.target || getPlatformFromHeaders(req.headers) || 'JSON';

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

$.info(`正在下载组合订阅:${name}`);
$.info(
`正在下载组合订阅:${name}\n请求 User-Agent: ${
req.headers['user-agent'] || req.headers['User-Agent']
}`,
);

let {
ignoreFailedRemoteSub,
Expand Down

0 comments on commit e28e2a7

Please sign in to comment.