Fix: Service Worker persistence, Ping-Pong failsafe, URL parsing, and server rate limit DoS

This commit is contained in:
Timo
2026-04-22 10:31:46 +02:00
parent 88cb313fc0
commit 0b28274766
4 changed files with 48 additions and 10 deletions
+7 -1
View File
@@ -268,7 +268,13 @@ function checkInviteLink() {
let serverUrl = '';
// Smart Link: Parse Server Config if present
if (parts.length >= 3 && (parts[parts.length - 2] === '0' || parts[parts.length - 2] === '1')) {
const last = parts[parts.length - 1];
const secondToLast = parts[parts.length - 2];
const decodedLast = decodeURIComponent(last || '');
const isCustom = secondToLast === '1' && (decodedLast.startsWith('ws://') || decodedLast.startsWith('wss://'));
const isOfficial = secondToLast === '0' && last === '';
if (parts.length >= 3 && (isCustom || isOfficial)) {
serverUrl = decodeURIComponent(parts.pop());
useCustomServer = parts.pop() === '1';
}