encodeURIComponent for static image proxy filename (#9410)
This commit is contained in:
		
							parent
							
								
									7f4ef18685
								
							
						
					
					
						commit
						af649b0480
					
				
					 2 changed files with 6 additions and 2 deletions
				
			
		|  | @ -8,7 +8,10 @@ export function getStaticImageUrl(baseUrl: string): string { | ||||||
| 		u.searchParams.set('static', '1'); | 		u.searchParams.set('static', '1'); | ||||||
| 		return u.href; | 		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({ | 	return `${instanceUrl}/proxy/${dummy}?${url.query({ | ||||||
| 		url: u.href, | 		url: u.href, | ||||||
| 		static: '1', | 		static: '1', | ||||||
|  |  | ||||||
|  | @ -137,7 +137,8 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(data | ||||||
| 								u.searchParams.set('badge', '1'); | 								u.searchParams.set('badge', '1'); | ||||||
| 								badge = u.href; | 								badge = u.href; | ||||||
| 							} else { | 							} else { | ||||||
| 								const dummy = `${u.host}${u.pathname}`;	// 拡張子がないとキャッシュしてくれないCDNがあるので
 | 								// 拡張子がないとキャッシュしてくれないCDNがあるので
 | ||||||
|  | 								const dummy = `${encodeURIComponent(`${u.host}${u.pathname}`)}.png`; | ||||||
| 								badge = `${origin}/proxy/${dummy}?${url.query({ | 								badge = `${origin}/proxy/${dummy}?${url.query({ | ||||||
| 									url: u.href, | 									url: u.href, | ||||||
| 									badge: '1' | 									badge: '1' | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue