This commit is contained in:
parent
ef3b4ef7bd
commit
b9343ee6e0
@ -12,8 +12,8 @@ import (
|
|||||||
|
|
||||||
// GetStatic returns static file content
|
// GetStatic returns static file content
|
||||||
func GetStatic(fs *embed.FS, c echo.Context) (err error) {
|
func GetStatic(fs *embed.FS, c echo.Context) (err error) {
|
||||||
basedir := "static"
|
var basedir = "static"
|
||||||
name := c.Param("*")
|
var name = c.Param("*")
|
||||||
if strings.HasSuffix(name, ".map") {
|
if strings.HasSuffix(name, ".map") {
|
||||||
return c.String(http.StatusNotFound, "")
|
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))
|
cnt, err := fs.ReadFile(fmt.Sprintf("%s/%s", basedir, name))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
|
return c.String(http.StatusNotFound, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.HasSuffix(name, ".js") {
|
if strings.HasSuffix(name, ".js") {
|
||||||
|
Loading…
Reference in New Issue
Block a user