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") {