From 649f82ef5224451ac682cc47976e4be4d735b31c Mon Sep 17 00:00:00 2001 From: dangered wolf Date: Mon, 5 Aug 2024 17:15:59 -0700 Subject: [PATCH] Revert "Separate x / twitter redirects #822" This reverts commit ac32c0a863bee6d3e4df96d98c8d17fac8cf3f3c. --- src/constants.ts | 1 - src/realms/twitter/router.ts | 7 +------ src/realms/twitter/routes/redirects.ts | 2 +- src/realms/twitter/routes/status.ts | 2 +- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/constants.ts b/src/constants.ts index 822b9a3..f7bce14 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -17,7 +17,6 @@ export const Constants = { GIF_TRANSCODE_DOMAIN: GIF_TRANSCODE_DOMAIN, API_DOCS_URL: `https://github.com/FixTweet/FxTwitter/wiki/API-Home`, TWITTER_ROOT: 'https://twitter.com', - X_ROOT: 'https://x.com', TWITTER_GLOBAL_NAME_ROOT: 'twitter.com', TWITTER_API_ROOT: 'https://api.twitter.com', TWITTER_VIDEO_BASE: 'https://video.twimg.com', diff --git a/src/realms/twitter/router.ts b/src/realms/twitter/router.ts index 7f3edc8..5df0bd7 100644 --- a/src/realms/twitter/router.ts +++ b/src/realms/twitter/router.ts @@ -24,12 +24,7 @@ export const getBaseRedirectUrl = (c: Context) => { return baseRedirect.endsWith('/') ? baseRedirect.slice(0, -1) : baseRedirect; } - // Workaround to redirect to correct root depending on request URL - if (c.req.url.includes('fixup')) { - return Constants.X_ROOT - } else { - return Constants.TWITTER_ROOT; - } + return Constants.TWITTER_ROOT; }; /* Workaround for some dumb maybe-build time issue where statusRequest isn't ready or something because none of these trigger*/ diff --git a/src/realms/twitter/routes/redirects.ts b/src/realms/twitter/routes/redirects.ts index f8b87f3..fc711b8 100644 --- a/src/realms/twitter/routes/redirects.ts +++ b/src/realms/twitter/routes/redirects.ts @@ -14,7 +14,7 @@ export const genericTwitterRedirect = async (c: Context) => { c.header('cache-control', cacheControl); } - return c.redirect(`${baseUrl}${url.pathname}?mx=1`, 302); + return c.redirect(`${baseUrl}${url.pathname}`, 302); }; export const setRedirectRequest = async (c: Context) => { diff --git a/src/realms/twitter/routes/status.ts b/src/realms/twitter/routes/status.ts index 5b0d528..d08cf3f 100644 --- a/src/realms/twitter/routes/status.ts +++ b/src/realms/twitter/routes/status.ts @@ -119,7 +119,7 @@ export const statusRequest = async (c: Context) => { if (!isBotUA && !flags.api && !flags.direct) { const baseUrl = getBaseRedirectUrl(c); - return c.redirect(`${baseUrl}/${handle || 'i'}/status/${id}?mx=1`, 302); + return c.redirect(`${baseUrl}/${handle || 'i'}/status/${id}`, 302); } c.status(200);