Remove DEPRECATED_DOMAIN_EPOCH

This commit is contained in:
dangered wolf 2023-12-08 20:10:53 -05:00
parent e394cbc931
commit bc71615cd2
No known key found for this signature in database
GPG key ID: 41E4D37680ED8B58
6 changed files with 2 additions and 8 deletions

View file

@ -5,7 +5,6 @@ TEXT_ONLY_DOMAINS = "t.fxtwitter.com,t.twittpr.com,t.fixupx.com"
INSTANT_VIEW_DOMAINS = "i.fxtwitter.com,i.twittpr.com,i.fixupx.com"
GALLERY_DOMAINS = "g.fxtwitter.com,g.twittpr.com,g.fixupx.com"
DEPRECATED_DOMAIN_LIST = "pxtwitter.com,www.pxtwitter.com"
DEPRECATED_DOMAIN_EPOCH = "1559320000000000000"
MOSAIC_DOMAIN_LIST = "mosaic.fxtwitter.com"
API_HOST_LIST = "api.fxtwitter.com,api-canary.fxtwitter.com"
HOST_URL = "https://fxtwitter.com"

View file

@ -44,8 +44,7 @@ let envVariables = [
'MOSAIC_DOMAIN_LIST',
'API_HOST_LIST',
'SENTRY_DSN',
'DEPRECATED_DOMAIN_LIST',
'DEPRECATED_DOMAIN_EPOCH'
'DEPRECATED_DOMAIN_LIST'
];
// Create defines for all environment variables

View file

@ -12,7 +12,6 @@
"DIRECT_MEDIA_DOMAINS": "d.fxtwitter.com,dl.fxtwitter.com,d.fixupx.com,dl.fixupx.com",
"MOSAIC_DOMAIN_LIST": "mosaic.fxtwitter.com",
"DEPRECATED_DOMAIN_LIST": "pxtwitter.com,www.pxtwitter.com",
"DEPRECATED_DOMAIN_EPOCH": "1559320000000000000",
"API_HOST_LIST": "api.fxtwitter.com",
"HOST_URL": "https://fxtwitter.com",
"REDIRECT_URL": "https://github.com/FixTweet/FixTweet",

View file

@ -7,7 +7,6 @@ export const Constants = {
INSTANT_VIEW_DOMAINS: INSTANT_VIEW_DOMAINS.split(','),
GALLERY_DOMAINS: GALLERY_DOMAINS.split(','),
DEPRECATED_DOMAIN_LIST: DEPRECATED_DOMAIN_LIST.split(','),
DEPRECATED_DOMAIN_EPOCH: BigInt(DEPRECATED_DOMAIN_EPOCH),
MOSAIC_DOMAIN_LIST: MOSAIC_DOMAIN_LIST.split(','),
API_HOST_LIST: API_HOST_LIST.split(','),
HOST_URL: HOST_URL,

View file

@ -66,8 +66,7 @@ export const statusRequest = async (c: Context) => {
/* The pxtwitter.com domain is deprecated and statuses posted after deprecation
date will have a notice saying we've moved to fxtwitter.com! */
if (
Constants.DEPRECATED_DOMAIN_LIST.includes(url.hostname) &&
BigInt(id?.match(/\d{2,20}/g)?.[0] || 0) > Constants.DEPRECATED_DOMAIN_EPOCH
Constants.DEPRECATED_DOMAIN_LIST.includes(url.hostname)
) {
console.log('Request to deprecated domain');
flags.deprecated = true;

1
src/types/env.d.ts vendored
View file

@ -5,7 +5,6 @@ declare const TEXT_ONLY_DOMAINS: string;
declare const INSTANT_VIEW_DOMAINS: string;
declare const GALLERY_DOMAINS: string;
declare const DEPRECATED_DOMAIN_LIST: string;
declare const DEPRECATED_DOMAIN_EPOCH: string;
declare const HOST_URL: string;
declare const EMBED_URL: string;
declare const REDIRECT_URL: string;