encodeURIComponent for static image proxy filename (#9410)

This commit is contained in:
tamaina
2022-12-25 18:05:53 +09:00
committed by GitHub
parent 7f4ef18685
commit af649b0480
2 changed files with 6 additions and 2 deletions

View File

@@ -8,7 +8,10 @@ export function getStaticImageUrl(baseUrl: string): string {
u.searchParams.set('static', '1');
return u.href;
}
const dummy = `${u.host}${u.pathname}`; // 拡張子がないとキャッシュしてくれないCDNがあるので
// 拡張子がないとキャッシュしてくれないCDNがあるのでダミーの名前を指定する
const dummy = `${encodeURIComponent(`${u.host}${u.pathname}`)}.webp`;
return `${instanceUrl}/proxy/${dummy}?${url.query({
url: u.href,
static: '1',