From f8f17881aa81c7f156f18c8eec6706940d33560a Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Fri, 3 May 2024 11:22:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=98=AF=E5=90=A6=E2=80=9C=E5=90=AF=E7=94=A8?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E8=87=AA=E5=AE=9A=E4=B9=89=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E2=80=9D=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/http_request.go | 2 ++ internal/nodes/http_request_page.go | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/nodes/http_request.go b/internal/nodes/http_request.go index 6331d37..de7ba15 100644 --- a/internal/nodes/http_request.go +++ b/internal/nodes/http_request.go @@ -506,6 +506,8 @@ func (this *HTTPRequest) configureWeb(web *serverconfigs.HTTPWebConfig, isTop bo } // pages + this.web.EnableGlobalPages = web.EnableGlobalPages + if len(web.Pages) > 0 { this.web.Pages = web.Pages } diff --git a/internal/nodes/http_request_page.go b/internal/nodes/http_request_page.go index 8579fb1..8f19ccd 100644 --- a/internal/nodes/http_request_page.go +++ b/internal/nodes/http_request_page.go @@ -17,7 +17,7 @@ const defaultPageContentType = "text/html; charset=utf-8" func (this *HTTPRequest) doPage(status int) (shouldStop bool) { if len(this.web.Pages) == 0 { // 集群自定义页面 - if this.nodeConfig != nil && this.ReqServer != nil { + if this.nodeConfig != nil && this.ReqServer != nil && this.web.EnableGlobalPages { var httpPagesPolicy = this.nodeConfig.FindHTTPPagesPolicyWithClusterId(this.ReqServer.ClusterId) if httpPagesPolicy != nil && httpPagesPolicy.IsOn && len(httpPagesPolicy.Pages) > 0 { return this.doPageLookup(httpPagesPolicy.Pages, status) @@ -34,7 +34,7 @@ func (this *HTTPRequest) doPage(status int) (shouldStop bool) { } // 集群自定义页面 - if this.nodeConfig != nil && this.ReqServer != nil { + if this.nodeConfig != nil && this.ReqServer != nil && this.web.EnableGlobalPages { var httpPagesPolicy = this.nodeConfig.FindHTTPPagesPolicyWithClusterId(this.ReqServer.ClusterId) if httpPagesPolicy != nil && httpPagesPolicy.IsOn && len(httpPagesPolicy.Pages) > 0 { return this.doPageLookup(httpPagesPolicy.Pages, status)