mirror of
https://github.com/gitbucket/gitbucket.git
synced 2026-01-04 22:59:58 +01:00
(refs #534)Allow to download large file
This commit is contained in:
@@ -294,9 +294,9 @@ trait RepositoryViewerControllerBase extends ControllerBase {
|
||||
getPathObjectId(git, path, revCommit).map { objectId =>
|
||||
if(raw){
|
||||
// Download
|
||||
defining(JGitUtil.getContentFromId(git, objectId, false).get){ bytes =>
|
||||
JGitUtil.getContentFromId(git, objectId, true).map {bytes =>
|
||||
RawData(FileUtil.getContentType(path, bytes), bytes)
|
||||
}
|
||||
} getOrElse NotFound
|
||||
} else {
|
||||
html.blob(id, repository, path.split("/").toList, JGitUtil.getContentInfo(git, path, objectId),
|
||||
new JGitUtil.CommitInfo(lastModifiedCommit), hasWritePermission(repository.owner, repository.name, context.loginAccount))
|
||||
|
||||
Reference in New Issue
Block a user