diff --git a/service/middleware.go b/service/middleware.go index 03f469c4..15d35a7d 100644 --- a/service/middleware.go +++ b/service/middleware.go @@ -39,8 +39,8 @@ func withStaticFileServer(c *gin.Context) { } // PWA app static file server - for root, length := range SpaRoots { - if length >= length && c.Request.URL.Path[0:length] == root { + for root, rootLength := range SpaRoots { + if rootLength >= length && c.Request.URL.Path[0:length] == root { c.Request.URL.Path = strings.TrimPrefix(c.Request.URL.Path, root) spaFileServers[root].ServeHTTP(c.Writer, c.Request) c.Abort()