1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-12-18 08:38:11 +09:00
hotomoe/src/client/app/common/scripts/get-static-image-url.ts

12 lines
398 B
TypeScript
Raw Normal View History

import { url as instanceUrl } from '../../config';
import * as url from '../../../../prelude/url';
export function getStaticImageUrl(baseUrl: string): string {
const u = new URL(baseUrl);
const dummy = `${u.host}${u.pathname}`; // 拡張子がないとキャッシュしてくれないCDNがあるので
return `${instanceUrl}/proxy/${dummy}?${url.query({
url: u.href,
static: '1'
})}`;
}