From 171914e9a75de4d03beb1f9f365c03ac1aeeb3b5 Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Sun, 4 Mar 2018 18:51:10 -0600 Subject: [PATCH] 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. --- routers/repo/attachment.go | 1 + 1 file changed, 1 insertion(+) diff --git a/routers/repo/attachment.go b/routers/repo/attachment.go index c2efb11c1d8b..302f5b33f7b7 100644 --- a/routers/repo/attachment.go +++ b/routers/repo/attachment.go @@ -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 }