diff --git a/internal/nodes/http_request.go b/internal/nodes/http_request.go index 9d43dc4..ca4274c 100644 --- a/internal/nodes/http_request.go +++ b/internal/nodes/http_request.go @@ -164,6 +164,16 @@ func (this *HTTPRequest) Do() { return } + // 处理健康检查 + var isHealthCheck = false + var healthCheckKey = this.RawReq.Header.Get(serverconfigs.HealthCheckHeaderName) + if len(healthCheckKey) > 0 { + if this.doHealthCheck(healthCheckKey, &isHealthCheck) { + this.doEnd() + return + } + } + if !this.isLnRequest { // 特殊URL处理 if len(this.rawURI) > 1 && this.rawURI[1] == '.' { @@ -191,6 +201,24 @@ func (this *HTTPRequest) Do() { return } + // UAM + if !isHealthCheck { + if this.web.UAM != nil { + if this.web.UAM.IsOn { + if this.doUAM() { + this.doEnd() + return + } + } + } else if this.ReqServer.UAM != nil && this.ReqServer.UAM.IsOn { + this.web.UAM = this.ReqServer.UAM + if this.doUAM() { + this.doEnd() + return + } + } + } + // WAF if this.web.FirewallRef != nil && this.web.FirewallRef.IsOn { if this.doWAFRequest() { @@ -262,33 +290,6 @@ func (this *HTTPRequest) doBegin() { this.RawReq.Body = ioutil.NopCloser(io.MultiReader(bytes.NewBuffer(this.requestBodyData), this.RawReq.Body)) } - // 处理健康检查 - var isHealthCheck = false - var healthCheckKey = this.RawReq.Header.Get(serverconfigs.HealthCheckHeaderName) - if len(healthCheckKey) > 0 { - if this.doHealthCheck(healthCheckKey, &isHealthCheck) { - return - } - } - - // UAM - if !isHealthCheck { - if this.web.UAM != nil { - if this.web.UAM.IsOn { - if this.doUAM() { - this.doEnd() - return - } - } - } else if this.ReqServer.UAM != nil && this.ReqServer.UAM.IsOn { - this.web.UAM = this.ReqServer.UAM - if this.doUAM() { - this.doEnd() - return - } - } - } - // 跳转 if len(this.web.HostRedirects) > 0 { if this.doHostRedirect() {