mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-04 07:24:13 +00:00 
			
		
		
		
	image以外はproxyしないように (#5051)
This commit is contained in:
		
							parent
							
								
									e9dc54c4d9
								
							
						
					
					
						commit
						67dda01fcb
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -17,6 +17,8 @@ export async function proxyMedia(ctx: Koa.BaseContext) {
 | 
			
		|||
 | 
			
		||||
		const [type, ext] = await detectMine(path);
 | 
			
		||||
 | 
			
		||||
		if (!type.startsWith('image/')) throw 403;
 | 
			
		||||
 | 
			
		||||
		let image: IImage;
 | 
			
		||||
 | 
			
		||||
		if ('static' in ctx.query && ['image/png', 'image/gif'].includes(type)) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue