mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-19 11:30:32 +01:00
11 lines
394 B
TypeScript
11 lines
394 B
TypeScript
import { url as instanceUrl } from '@client/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'
|
|
})}`;
|
|
}
|