mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-16 23:17:33 -07:00
10 lines
374 B
TypeScript
10 lines
374 B
TypeScript
|
import { url as instanceUrl } from '../../config';
|
||
|
|
||
|
export function getStaticImageUrl(url: string): string {
|
||
|
const u = new URL(url);
|
||
|
const dummy = `${u.host}${u.pathname}`; // 拡張子がないとキャッシュしてくれないCDNがあるので
|
||
|
let result = `${instanceUrl}/proxy/${dummy}?url=${encodeURIComponent(u.href)}`;
|
||
|
result += '&static=1';
|
||
|
return result;
|
||
|
}
|