From 040a2c3e00708c9d3bbf2c5c5bcd8b37a7a70d16 Mon Sep 17 00:00:00 2001 From: Kiyan Gauss Date: Sat, 4 Mar 2023 23:34:29 +0800 Subject: [PATCH] fix bug: embed.FS index.html render --- routergroup.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routergroup.go b/routergroup.go index c833fe8f..12de23aa 100644 --- a/routergroup.go +++ b/routergroup.go @@ -224,7 +224,7 @@ func (group *RouterGroup) createStaticHandler(relativePath string, fs http.FileS file := c.Param("filepath") // Check if file exists and/or if we have permission to access it - f, err := fs.Open(file) + f, err := fs.Open(path.Clean(file)) if err != nil { c.Writer.WriteHeader(http.StatusNotFound) c.handlers = group.engine.noRoute