Refine VPN client instructions and subscription refresh flow
All checks were successful
Build and Deploy Gateway / build-and-push (push) Successful in 14s
Build and Deploy Gateway / deploy (push) Successful in 1s

This commit is contained in:
2026-07-11 12:34:14 +03:00
parent 6f565ded2e
commit fa3b455fab
11 changed files with 730 additions and 36 deletions

View File

@@ -160,13 +160,13 @@ async function requestSubscription(url) {
return response;
}
export async function fetchSubscriptionInfo(url) {
const response = await requestSubscription(url);
await response.body?.cancel();
return {
userInfo: parseUserInfo(response.headers.get('subscription-userinfo')),
fetchedAt: new Date().toISOString(),
};
export function selectRefreshedServer(currentTag, servers) {
const selectedTag = String(currentTag || '').trim();
if (!selectedTag) return '';
return servers.find((server) => String(server.tag || '').trim() === selectedTag)?.tag
|| servers[0]?.tag
|| '';
}
export async function fetchSubscription(url) {