mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2026-04-07 02:33:17 +08:00
feat: 默认输出格式改为 V2Ray; accept 为 application/json 时, 输出 JSON; 响应增加 X-Powered-By Sub-Store
This commit is contained in:
@@ -6,21 +6,19 @@ import $ from '@/core/app';
|
||||
import headersResourceCache from '@/utils/headers-resource-cache';
|
||||
|
||||
export function getFlowField(headers) {
|
||||
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;
|
||||
const keys = Object.keys(headers);
|
||||
let sub = '';
|
||||
let webPage = '';
|
||||
for (let k of keys) {
|
||||
const lower = k.toLowerCase();
|
||||
if (lower === 'subscription-userinfo') {
|
||||
sub = headers[k];
|
||||
} else if (lower === 'profile-web-page-url') {
|
||||
webPage = headers[k];
|
||||
}
|
||||
return subKey && webPageKey;
|
||||
});
|
||||
}
|
||||
|
||||
return `${headers[subKey] || ''}${
|
||||
webPageKey ? `;app_url=${headers[webPageKey]}` : ''
|
||||
}`;
|
||||
return `${sub || ''}${webPage ? `;app_url=${webPage}` : ''}`;
|
||||
}
|
||||
export async function getFlowHeaders(
|
||||
rawUrl,
|
||||
|
||||
Reference in New Issue
Block a user