アニメーション画像を無効にする際、サーバーサイドではなくクライアントサイドでURLを変更するように
This commit is contained in:
9
src/client/app/common/scripts/get-static-image-url.ts
Normal file
9
src/client/app/common/scripts/get-static-image-url.ts
Normal file
@ -0,0 +1,9 @@
|
||||
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;
|
||||
}
|
Reference in New Issue
Block a user