diff options
Diffstat (limited to 'modules/lfs/server.go')
-rw-r--r-- | modules/lfs/server.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/lfs/server.go b/modules/lfs/server.go index dc498a86c8..d6798ec4f5 100644 --- a/modules/lfs/server.go +++ b/modules/lfs/server.go @@ -233,6 +233,12 @@ func PostHandler(ctx *context.Context) { return } + if setting.LFS.MaxFileSize > 0 && rv.Size > setting.LFS.MaxFileSize { + log.Info("Denied LFS upload of size %d to %s/%s because of LFS_MAX_FILE_SIZE=%d", rv.Size, rv.User, rv.Repo, setting.LFS.MaxFileSize) + writeStatus(ctx, 413) + return + } + meta, err := models.NewLFSMetaObject(&models.LFSMetaObject{Oid: rv.Oid, Size: rv.Size, RepositoryID: repository.ID}) if err != nil { writeStatus(ctx, 404) |