fix: migrate gifs to klipy service (#1220)

This commit is contained in:
Hampus authored and GitHub committed 2026-06-30 01:19:57 +02:00
1 parent 99eedf6d1e
commit 4a741d8396
79 files changed
+3032 -1653

No files matched your search

@@ -18,8 +18,6 @@ export const EXTERNAL_RESPONSE_LIMITS = {
blueskyProfileBytes: 256 * 1024,
wikipediaSummaryBytes: 256 * 1024,
oEmbedBytes: 256 * 1024,
klipyApiBytes: 512 * 1024,
tenorApiBytes: 512 * 1024,
pwnedPasswordsBytes: 1024 * 1024,
rdapBytes: 512 * 1024,
externalTemplateBytes: 512 * 1024,
+8 -7
View File
@@ -16,16 +16,17 @@ interface GetIpAddressReverseOptions {
cacheTtlSeconds?: number;
}
export function resolveRequestClientIp(req: Request): string | null {
return extractClientIp(req, {
trustClientIpHeader: Config.proxy.trust_client_ip_header,
clientIpHeaderName: Config.proxy.client_ip_header,
});
}
export async function lookupGeoip(req: Request): Promise<GeoipResult>;
export async function lookupGeoip(ip: string): Promise<GeoipResult>;
export async function lookupGeoip(input: string | Request): Promise<GeoipResult> {
const ip =
typeof input === 'string'
? input
: extractClientIp(input, {
trustClientIpHeader: Config.proxy.trust_client_ip_header,
clientIpHeaderName: Config.proxy.client_ip_header,
});
const ip = typeof input === 'string' ? input : resolveRequestClientIp(input);
if (!ip) {
return {countryCode: null, normalizedIp: null, city: null, region: null, countryName: null};
}