dkforest

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

commit 1f49421c908cc8b78dd0fea801fe2ef5762d7d1e
parent 75c7d7590954b4e3832ec98ac358f67990f090af
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Thu, 22 Dec 2022 17:11:16 -0800

cleanup

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

diff --git a/pkg/web/handlers/handlers.go b/pkg/web/handlers/handlers.go @@ -3913,7 +3913,7 @@ func UploadsDownloadHandler(c echo.Context) error { if file.FileSize < 1<<20 { fi, decFileBytes, err := file.GetContent() - if err != nil { + if err != nil || fi.IsDir() { return echo.NotFoundHandler(c) } buf := bytes.NewReader(decFileBytes) @@ -3932,9 +3932,6 @@ func UploadsDownloadHandler(c echo.Context) error { mimeType == "image/bmp" || mimeType == "image/x-icon" || mimeType == "image/webp" { - if fi.IsDir() { - return echo.NotFoundHandler(c) - } http.ServeContent(c.Response(), c.Request(), fi.Name(), fi.ModTime(), buf) return nil }