From e4be419c54d4b30f1d39d856e47d6f699362b92b Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Wed, 20 Oct 2021 17:13:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A0=A1=E9=AA=8CACME?= =?UTF-8?q?=E8=AF=81=E4=B9=A6=E6=97=B6=E5=8F=97=E8=87=AA=E5=8A=A8=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E7=AD=89=E8=AE=BE=E7=BD=AE=E7=9A=84=E5=BD=B1=E5=93=8D?= =?UTF-8?q?=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.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/internal/nodes/http_request.go b/internal/nodes/http_request.go index 03c97de..29ed6c3 100644 --- a/internal/nodes/http_request.go +++ b/internal/nodes/http_request.go @@ -126,6 +126,17 @@ func (this *HTTPRequest) Do() { return } + // 特殊URL处理 + if len(this.rawURI) > 1 && this.rawURI[1] == '.' { + // ACME + // TODO 需要配置是否启用ACME检测 + if strings.HasPrefix(this.rawURI, "/.well-known/acme-challenge/") { + this.doACME() + this.doEnd() + return + } + } + // WAF if this.web.FirewallRef != nil && this.web.FirewallRef.IsOn { if this.doWAFRequest() { @@ -167,16 +178,6 @@ func (this *HTTPRequest) Do() { // 开始调用 func (this *HTTPRequest) doBegin() { - // 特殊URL处理 - if len(this.rawURI) > 1 && this.rawURI[1] == '.' { - // ACME - // TODO 需要配置是否启用ACME检测 - if strings.HasPrefix(this.rawURI, "/.well-known/acme-challenge/") { - this.doACME() - return - } - } - // 处理健康检查 var healthCheckKey = this.RawReq.Header.Get(serverconfigs.HealthCheckHeaderName) if len(healthCheckKey) > 0 {