proxyで400番台はそのステータスを返す (#4154)
This commit is contained in:
		
							parent
							
								
									8a11322802
								
							
						
					
					
						commit
						18fd39b335
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -42,7 +42,12 @@ export async function proxyMedia(ctx: Koa.BaseContext) {
 | 
			
		|||
		ctx.body = image.data;
 | 
			
		||||
	} catch (e) {
 | 
			
		||||
		serverLogger.error(e);
 | 
			
		||||
		ctx.status = 500;
 | 
			
		||||
 | 
			
		||||
		if (typeof e == 'number' && e >= 400 && e < 500) {
 | 
			
		||||
			ctx.status = e;
 | 
			
		||||
		} else {
 | 
			
		||||
			ctx.status = 500;
 | 
			
		||||
		}
 | 
			
		||||
	} finally {
 | 
			
		||||
		cleanup();
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue