mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-03 21:08:25 +00:00 
			
		
		
		
	Log attachment blocked events (#3615)
Include both a log entry and the blocked mime type in the gitea log when an attachment upload is blocked. Chosen log level is info; this may need to be dialed down to trace.
This commit is contained in:
		
				
					committed by
					
						
						Lunny Xiao
					
				
			
			
				
	
			
			
			
						parent
						
							19d5192e8c
						
					
				
				
					commit
					171914e9a7
				
			@@ -55,6 +55,7 @@ func UploadAttachment(ctx *context.Context) {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if !allowed {
 | 
			
		||||
		log.Info("Attachment with type %s blocked from upload", fileType)
 | 
			
		||||
		ctx.Error(400, ErrFileTypeForbidden.Error())
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user