feat: 支持单条订阅和组合订阅配置 "不查询订阅流量信息"; 支持订阅链接参数传入 noFlow 强制指定 "不查询订阅流量信息"

This commit is contained in:
xream committed 2026-08-02 19:07:08 +08:00
1 parent 47ce75a444
commit 2700c8ca50
10 files changed
+529 -39

No files matched your search

+44
View File
@@ -208,6 +208,50 @@ describe('download github proxy regex', function () {
expect(maxActiveRequests).to.equal(1);
});
it('keeps noFlow during custom cache refreshes', async function () {
for (const awaitCustomCache of [true, false]) {
const cacheKey = `refresh-${awaitCustomCache}`;
const sourceUrl = `https://example.com/${cacheKey}`;
const requests = [];
state[`#sub-store-cached-custom-${cacheKey}`] = 'cached-body';
openApi.HTTP = () => ({
get: async ({ url }) => {
requests.push(['GET', url]);
return {
body: 'fresh-body',
headers: {},
statusCode: 200,
};
},
head: async ({ url }) => {
requests.push(['HEAD', url]);
return {
headers: {
'subscription-userinfo':
'upload=1; download=2; total=3; expire=4102444800',
},
statusCode: 200,
};
},
});
await download(
`${sourceUrl}#validCheck&cacheKey=${cacheKey}`,
undefined,
undefined,
undefined,
undefined,
awaitCustomCache,
true,
undefined,
{ noFlow: 'false' },
);
if (!awaitCustomCache) await sleep(10);
expect(requests).to.deep.equal([['GET', sourceUrl]]);
}
});
it('logs download failures before rejecting', async function () {
openApi.HTTP = () => ({
get: async () => {