mirror of
https://github.com/marcogll/soul23_placeholder_site_server.git
synced 2026-01-13 13:25:18 +00:00
fix: Correct Telegram redirection URL to ensure proper navigation to the official download page
This commit is contained in:
19
server.js
19
server.js
@@ -18,14 +18,27 @@ app.get("/healthchecker", (req, res) => {
|
||||
|
||||
// Magic link para redirigir a la app de Telegram según plataforma
|
||||
app.get("/telegram", (req, res) => {
|
||||
const ua = (req.headers["user-agent"] || "").toLowerCase();
|
||||
const uaRaw = req.headers["user-agent"] || "";
|
||||
const ua = uaRaw.toLowerCase();
|
||||
|
||||
const isIOS =
|
||||
// Log para debug
|
||||
console.log("[/telegram] User-Agent:", uaRaw);
|
||||
|
||||
// Permitir forzar plataforma por query param: ?platform=ios|android
|
||||
const platform = (req.query.platform || "").toString().toLowerCase();
|
||||
|
||||
const isIOSQuery = platform === "ios";
|
||||
const isAndroidQuery = platform === "android";
|
||||
|
||||
const isIOSUA =
|
||||
ua.includes("iphone") ||
|
||||
ua.includes("ipad") ||
|
||||
ua.includes("ipod") ||
|
||||
ua.includes("ios");
|
||||
const isAndroid = ua.includes("android");
|
||||
const isAndroidUA = ua.includes("android");
|
||||
|
||||
const isIOS = isIOSQuery || isIOSUA;
|
||||
const isAndroid = isAndroidQuery || isAndroidUA;
|
||||
|
||||
if (isIOS) {
|
||||
// iOS -> App Store
|
||||
|
||||
Reference in New Issue
Block a user