Skip to content

Commit ff473d0

Browse files
committed
refactor: share subscription import user agents
1 parent 2f84a59 commit ff473d0

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

packages/server-core/src/subscription/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ export * from "./response-headers";
1212
export * from "./saved-sources";
1313
export * from "./source-import";
1414
export * from "./ssrf-ip";
15+
export * from "./user-agents";

packages/server-core/src/subscription/source-import.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,7 @@ import {
1212
import { tryNormalizeSubscriptionUrlInput } from "@subboost/core/subscription/url-input";
1313
import type { ParseResult, ParsedNode } from "@subboost/core/types/node";
1414
import { shouldTryClashMetaForV2raynPayload } from "./fetch-profile-heuristics";
15-
16-
export const SUBSCRIPTION_IMPORT_USER_AGENTS = [
17-
"v2rayN/7.20.4",
18-
"mihomo/1.19.24",
19-
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
20-
] as const;
15+
import { SUBSCRIPTION_IMPORT_USER_AGENTS } from "./user-agents";
2116

2217
export type SourceImportPurpose = "content" | "userinfo";
2318

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export const SUBSCRIPTION_IMPORT_USER_AGENTS = [
2+
"v2rayN/7.20.4",
3+
"mihomo/1.19.24",
4+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
5+
] as const;

0 commit comments

Comments
 (0)