mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 07:09:00 +08:00
feat: 支持解析订阅中的 profile-web-page-url
字段
This commit is contained in:
parent
4790bf47d1
commit
cfb5a8e082
@ -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": {
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user