misc fix in qrz
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Paul 2023-07-13 00:24:33 +02:00
parent ef3b4ef7bd
commit b9343ee6e0

View File

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