This commit is contained in:
parent
ef3b4ef7bd
commit
b9343ee6e0
@ -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") {
|
||||
|
Loading…
Reference in New Issue
Block a user