Skip to content

Commit

Permalink
feat: 支持解析订阅中的 profile-web-page-url 字段
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Nov 16, 2024
1 parent 4790bf4 commit cfb5a8e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 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.418",
"version": "2.14.419",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {
Expand Down
19 changes: 15 additions & 4 deletions backend/src/utils/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,21 @@ import $ from '@/core/app';
import headersResourceCache from '@/utils/headers-resource-cache';

export function getFlowField(headers) {
const subkey = Object.keys(headers).filter((k) =>
/SUBSCRIPTION-USERINFO/i.test(k),
)[0];
return headers[subkey];
let subKey = '';
let webPageKey = '';

Object.keys(headers).some((k) => {
if (/SUBSCRIPTION-USERINFO/i.test(k)) {
subKey = k;
} else if (/PROFILE-WEB-PAGE-URL/i.test(k)) {
webPageKey = k;
}
return subKey && webPageKey;
});

return `${headers[subKey] || ''}${
webPageKey ? `;app_url=${headers[webPageKey]}` : ''
}`;
}
export async function getFlowHeaders(
rawUrl,
Expand Down

0 comments on commit cfb5a8e

Please sign in to comment.