From 2fb9674171e96d2934a203d57db892642d08c41a Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Sun, 30 Jul 2023 19:03:21 +0800 Subject: [PATCH] Fix file not exist panic in StaticFilter() --- routers/static_filter.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/routers/static_filter.go b/routers/static_filter.go index b6bc4ccd..b8ecc9fc 100644 --- a/routers/static_filter.go +++ b/routers/static_filter.go @@ -64,6 +64,9 @@ func StaticFilter(ctx *context.Context) { if !util.FileExist(path) { path = "web/build/index.html" } + if !util.FileExist(path) { + return + } if oldStaticBaseUrl == newStaticBaseUrl { makeGzipResponse(ctx.ResponseWriter, ctx.Request, path)