Skip to content
Snippets Groups Projects
Unverified Commit af649b04 authored by tamaina's avatar tamaina Committed by GitHub
Browse files

encodeURIComponent for static image proxy filename (#9410)

parent 7f4ef186
No related branches found
No related tags found
No related merge requests found
......@@ -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',
......
......@@ -137,7 +137,8 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(data
u.searchParams.set('badge', '1');
badge = u.href;
} else {
const dummy = `${u.host}${u.pathname}`; // 拡張子がないとキャッシュしてくれないCDNがあるので
// 拡張子がないとキャッシュしてくれないCDNがあるので
const dummy = `${encodeURIComponent(`${u.host}${u.pathname}`)}.png`;
badge = `${origin}/proxy/${dummy}?${url.query({
url: u.href,
badge: '1'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment