From 28bf65e88a83d4562a27a0a7dd6bab77c49c093b Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Sun, 27 Aug 2023 21:38:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=8A=B6=E6=9C=AA=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E5=9F=9F=E5=90=8D=E4=B8=AD${status}=E5=92=8C${statusM?= =?UTF-8?q?essage}=E5=8F=98=E9=87=8F=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/http_request_mismatch.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/nodes/http_request_mismatch.go b/internal/nodes/http_request_mismatch.go index 01682bb..b8b5d41 100644 --- a/internal/nodes/http_request_mismatch.go +++ b/internal/nodes/http_request_mismatch.go @@ -49,6 +49,7 @@ func (this *HTTPRequest) doMismatch() { // 是否正在访问IP if globalServerConfig.HTTPAll.NodeIPShowPage && net.ParseIP(this.ReqHost) != nil { + this.writer.statusCode = statusCode var contentHTML = this.Format(globalServerConfig.HTTPAll.NodeIPPageHTML) this.writer.Header().Set("Content-Type", "text/html; charset=utf-8") this.writer.Header().Set("Content-Length", types.String(len(contentHTML))) @@ -73,6 +74,7 @@ func (this *HTTPRequest) doMismatch() { // 处理当前连接 if mismatchAction != nil && mismatchAction.Code == "page" { if mismatchAction.Options != nil { + this.writer.statusCode = statusCode var contentHTML = this.Format(mismatchAction.Options.GetString("contentHTML")) this.writer.Header().Set("Content-Type", "text/html; charset=utf-8") this.writer.Header().Set("Content-Length", types.String(len(contentHTML)))