From 482eb61168ddd4ee5914aa3fdb07e34961cb05d9 Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Tue, 5 Dec 2023 18:32:54 +0800 Subject: [PATCH] feat: improve StaticFilter() --- routers/static_filter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/static_filter.go b/routers/static_filter.go index b3248cf6c86a..a1075f934bfd 100644 --- a/routers/static_filter.go +++ b/routers/static_filter.go @@ -129,7 +129,7 @@ func StaticFilter(ctx *context.Context) { path += urlPath } - if !util.FileExist(path) { + if strings.Contains(path, "/../") || !util.FileExist(path) { path = webBuildFolder + "/index.html" } if !util.FileExist(path) {