fix: remove redundant file return

This commit is contained in:
ns2kracy 2024-09-14 18:57:06 +08:00
parent e4bf67dad5
commit e9a9a9f464
No known key found for this signature in database
GPG Key ID: 3E6E5EE4AFFF61DB

View File

@ -257,7 +257,6 @@ func GetDownloadSingleFile(ctx echo.Context) error {
ctx.Request().Header.Add("Content-Length", strconv.FormatInt(node.Size(), 10))
}
http.ServeContent(ctx.Response().Writer, ctx.Request(), fileName, node.ModTime(), fi)
// http.ServeFile(c.Writer, ctx.Request(), filePath)
defer fi.Close()
fileTmp, err := os.Open(filePath)
if err != nil {
@ -268,7 +267,7 @@ func GetDownloadSingleFile(ctx echo.Context) error {
}
defer fileTmp.Close()
return ctx.File(filePath)
return nil
}
// @Summary 获取目录列表