Skip to content

Commit 51f5a1f

Browse files
authored
修bug
1 parent 1e0a8de commit 51f5a1f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

明文源吗

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,6 +1571,15 @@ async function fetchAndParseWetest(url) {
15711571
}
15721572

15731573
async function handleWsRequest(request) {
1574+
// 检测并设置当前Worker地区,确保WebSocket请求能正确进行就近匹配
1575+
if (!currentWorkerRegion || currentWorkerRegion === '') {
1576+
if (manualWorkerRegion && manualWorkerRegion.trim()) {
1577+
currentWorkerRegion = manualWorkerRegion.trim().toUpperCase();
1578+
} else {
1579+
currentWorkerRegion = await detectWorkerRegion(request);
1580+
}
1581+
}
1582+
15741583
const wsPair = new WebSocketPair();
15751584
const [clientSock, serverSock] = Object.values(wsPair);
15761585
serverSock.accept();
@@ -1931,7 +1940,7 @@ async function handleSubscriptionPage(request, user = null) {
19311940
KR: '🇰🇷 韩国', DE: '🇩🇪 德国', SE: '🇸🇪 瑞典', NL: '🇳🇱 荷兰',
19321941
FI: '🇫🇮 芬兰', GB: '🇬🇧 英国'
19331942
},
1934-
terminal: '终端 v2.2',
1943+
terminal: '终端 v2.3',
19351944
githubProject: 'GitHub 项目',
19361945
autoDetectClient: '自动识别',
19371946
selectionLogicText: '同地区 → 邻近地区 → 其他地区',
@@ -2038,7 +2047,7 @@ async function handleSubscriptionPage(request, user = null) {
20382047
KR: '🇰🇷 کره جنوبی', DE: '🇩🇪 آلمان', SE: '🇸🇪 سوئد', NL: '🇳🇱 هلند',
20392048
FI: '🇫🇮 فنلاند', GB: '🇬🇧 بریتانیا'
20402049
},
2041-
terminal: 'ترمینال v2.2',
2050+
terminal: 'ترمینال v2.3',
20422051
githubProject: 'پروژه GitHub',
20432052
autoDetectClient: 'تشخیص خودکار',
20442053
selectionLogicText: 'هم‌منطقه → منطقه مجاور → سایر مناطق',

0 commit comments

Comments
 (0)