From 668369603286d3d0a04c06f633e28d0933fe8be8 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Fri, 20 Dec 2024 11:03:49 +0800 Subject: [PATCH] fix(system): Fix Cloudflare Proxy Access Issue with 1Panel When Secure Entry Is Enabled (#7458) --- backend/init/router/router.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/init/router/router.go b/backend/init/router/router.go index 750ea65f6d0d..e1c4eae898dd 100644 --- a/backend/init/router/router.go +++ b/backend/init/router/router.go @@ -28,9 +28,9 @@ var ( ) func toIndexHtml(c *gin.Context) { + c.Writer.Header().Set("Content-Type", "text/html; charset=utf-8") c.Writer.WriteHeader(http.StatusOK) _, _ = c.Writer.Write(web.IndexByte) - c.Writer.Header().Add("Accept", "text/html") c.Writer.Flush() } @@ -131,9 +131,9 @@ func setWebStatic(rootRouter *gin.RouterGroup) { handleNoRoute(c) return } + c.Writer.Header().Set("Content-Type", "text/html; charset=utf-8") c.Writer.WriteHeader(http.StatusOK) _, _ = c.Writer.Write(web.IndexByte) - c.Writer.Header().Add("Accept", "text/html") c.Writer.Flush() }) }