Fix wrong file size issue when cloning and pulling contents via git-lfs. (#2330)

This commit is contained in:
watari3
2019-06-17 00:45:24 +09:00
committed by Naoki Takezoe
parent 433639dd04
commit 1f564808d5

View File

@@ -28,7 +28,7 @@ class GitLfsTransferServlet extends HttpServlet {
if (file.exists()) {
res.setStatus(HttpStatus.SC_OK)
res.setContentType("application/octet-stream")
res.setContentLength(file.length.toInt)
res.setHeader("Content-Length", file.length.toString)
using(new FileInputStream(file), res.getOutputStream) { (in, out) =>
IOUtils.copy(in, out)
out.flush()