dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit 754c75f03d23802bec2fc84a64aa0832e9f9d667
parent 877e217745b6c480a818e3736d74e9e649be25ed
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Fri,  3 Feb 2023 17:15:56 -0800

add error handling

Diffstat:
Mpkg/web/handlers/handlers.go | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pkg/web/handlers/handlers.go b/pkg/web/handlers/handlers.go @@ -4513,7 +4513,10 @@ func FileDropDkfDownloadHandler(c echo.Context) error { chunkNum := utils.DoParseInt64(c.Request().PostFormValue("chunk")) buf := make([]byte, maxChunkSize) - n, _ := f.ReadAt(buf, chunkNum*maxChunkSize) + n, err := f.ReadAt(buf, chunkNum*maxChunkSize) + if err != nil { + logrus.Error(err) + } c.Response().Header().Set(echo.HeaderContentDisposition, fmt.Sprintf("attachment; filename=chunk_%d", chunkNum)) if _, err := io.Copy(c.Response().Writer, bytes.NewReader(buf[:n])); err != nil {