Skip to content

Commit

Permalink
fix: 修复组合订阅中的单条订阅透传 User-Agent
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Jan 14, 2025
1 parent 03e320c commit 2155cc9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 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.16.13",
"version": "2.16.14",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {
Expand Down
4 changes: 3 additions & 1 deletion backend/src/restful/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,12 @@ async function produceArtifact({
subnames.map(async (name) => {
const sub = findByName(allSubs, name);
const passThroughUA = sub.passThroughUA;
let reqUA = sub.ua;
if (passThroughUA) {
$.info(
`订阅开启了透传 User-Agent, 使用请求的 User-Agent: ${ua}`,
);
reqUA = ua;
}
try {
$.info(`正在处理子订阅:${sub.name}...`);
Expand All @@ -243,7 +245,7 @@ async function produceArtifact({
try {
return await download(
url,
ua || sub.ua,
reqUA,
undefined,
proxy ||
sub.proxy ||
Expand Down

0 comments on commit 2155cc9

Please sign in to comment.