From 75a579cb4feb579a60034984d05f34af1293e5c4 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Wed, 20 Sep 2023 08:21:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DURL=E5=9F=9F=E5=90=8D?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E8=AE=BE=E7=BD=AE=E5=8F=AF=E8=83=BD=E4=B8=8D?= =?UTF-8?q?=E7=94=9F=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/http_request_host_redirect.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/nodes/http_request_host_redirect.go b/internal/nodes/http_request_host_redirect.go index 0772c5f..12837e7 100644 --- a/internal/nodes/http_request_host_redirect.go +++ b/internal/nodes/http_request_host_redirect.go @@ -139,11 +139,6 @@ func (this *HTTPRequest) doHostRedirect() (blocked bool) { } } - // 如果跳转前后域名一致,则终止 - if u.DomainAfter == reqHost { - return false - } - var scheme = u.DomainAfterScheme if len(scheme) == 0 { scheme = this.requestScheme() @@ -155,6 +150,11 @@ func (this *HTTPRequest) doHostRedirect() (blocked bool) { return false } + // 如果跳转前后域名一致,则终止 + if u.DomainAfter == reqHost { + return false + } + this.ProcessResponseHeaders(this.writer.Header(), status) // 参数