mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-19 05:55:34 +09:00
fix: migrate gifs to klipy service (#1220)
This commit is contained in:
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,
|
||||
|
||||
@@ -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};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user