From b9343ee6e06af4d35a36f13c8cfe563c9fe71915 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Thu, 13 Jul 2023 00:24:33 +0200 Subject: [PATCH] misc fix in qrz --- src/static/main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/static/main.go b/src/static/main.go index 5041c1b..3468634 100644 --- a/src/static/main.go +++ b/src/static/main.go @@ -12,8 +12,8 @@ import ( // GetStatic returns static file content func GetStatic(fs *embed.FS, c echo.Context) (err error) { - basedir := "static" - name := c.Param("*") + var basedir = "static" + var name = c.Param("*") if strings.HasSuffix(name, ".map") { return c.String(http.StatusNotFound, "") } @@ -21,6 +21,7 @@ func GetStatic(fs *embed.FS, c echo.Context) (err error) { cnt, err := fs.ReadFile(fmt.Sprintf("%s/%s", basedir, name)) if err != nil { log.Println(err) + return c.String(http.StatusNotFound, "") } if strings.HasSuffix(name, ".js") {