summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorMahmoud Al-Qudsi <mqudsi@neosmart.net>2018-03-04 18:51:10 -0600
committerLunny Xiao <xiaolunwen@gmail.com>2018-03-05 08:51:10 +0800
commit171914e9a75de4d03beb1f9f365c03ac1aeeb3b5 (patch)
treed5eaebdcce2c992cade9068a38263ee07a9a41ef /routers
parent19d5192e8c654ea186719032bfb848b12d3760ab (diff)
downloadgitea-171914e9a75de4d03beb1f9f365c03ac1aeeb3b5.tar.gz
gitea-171914e9a75de4d03beb1f9f365c03ac1aeeb3b5.zip
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.
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/attachment.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/routers/repo/attachment.go b/routers/repo/attachment.go
index c2efb11c1d..302f5b33f7 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
}