From 4106e2a996ef94994d2e8271de03a7d042523779 Mon Sep 17 00:00:00 2001 From: MadDogOwner Date: Thu, 24 Jul 2025 22:28:58 +0800 Subject: [PATCH] fix(static): correct CDN fetch condition for index.html (#814) --- server/static/static.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/static/static.go b/server/static/static.go index f26233d4..47eabb54 100644 --- a/server/static/static.go +++ b/server/static/static.go @@ -44,7 +44,8 @@ func replaceStrings(content string, replacements map[string]string) string { func initIndex() { utils.Log.Debug("Initializing index.html...") siteConfig := getSiteConfig() - if conf.Conf.DistDir != "" || (conf.Conf.Cdn != "" && (conf.WebVersion == "" || conf.WebVersion == "beta" || conf.WebVersion == "dev")) { + // dist_dir is empty and cdn is not empty add web_version is empty or beta or dev + if conf.Conf.DistDir == "" && conf.Conf.Cdn != "" && (conf.WebVersion == "" || conf.WebVersion == "beta" || conf.WebVersion == "dev") { utils.Log.Infof("Fetching index.html from CDN: %s/index.html...", conf.Conf.Cdn) resp, err := base.RestyClient.R(). SetHeader("Accept", "text/html").