Compare commits

..

2 Commits

Author SHA1 Message Date
Ns2Kracy
2adb795896 Update to 0.4.13 (#2004) 2024-09-18 15:53:41 +08:00
Ns2Kracy
8b251dc407 fix: get file content twice (#2000) 2024-09-14 23:21:03 +08:00
2 changed files with 2 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ package common
const (
SERVICENAME = "casaos"
VERSION = "0.4.12"
VERSION = "0.4.13"
BODY = " "
RANW_NAME = "IceWhale-RemoteAccess"
)

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 获取目录列表