소스 검색

Fix LFS max file size enforcement (#10593)

Unfortunately the batch handler also needs to enforce max file size.
Enforce max file size in batch handler
tags/v1.10.5
zeripath 4 년 전
부모
커밋
0b3a9c4f85
No account linked to committer's email address
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6
    0
      modules/lfs/server.go

+ 6
- 0
modules/lfs/server.go 파일 보기

@@ -307,6 +307,12 @@ func BatchHandler(ctx *context.Context) {
continue
}

if requireWrite && setting.LFS.MaxFileSize > 0 && object.Size > setting.LFS.MaxFileSize {
log.Info("Denied LFS upload of size %d to %s/%s because of LFS_MAX_FILE_SIZE=%d", object.Size, object.User, object.Repo, setting.LFS.MaxFileSize)
writeStatus(ctx, 413)
return
}

// Object is not found
meta, err = models.NewLFSMetaObject(&models.LFSMetaObject{Oid: object.Oid, Size: object.Size, RepositoryID: repository.ID})
if err == nil {

Loading…
취소
저장