diff --git a/internal/nodes/http_request.go b/internal/nodes/http_request.go index db5122c..6e7acfb 100644 --- a/internal/nodes/http_request.go +++ b/internal/nodes/http_request.go @@ -241,9 +241,18 @@ func (this *HTTPRequest) doBegin() { } // 处理健康检查 + var isHealthCheck = false var healthCheckKey = this.RawReq.Header.Get(serverconfigs.HealthCheckHeaderName) if len(healthCheckKey) > 0 { - if this.doHealthCheck(healthCheckKey) { + if this.doHealthCheck(healthCheckKey, &isHealthCheck) { + return + } + } + + // UAM + if !isHealthCheck && this.ReqServer.UAM != nil && this.ReqServer.UAM.IsOn { + if this.doUAM() { + this.doEnd() return } } diff --git a/internal/nodes/http_request_health_check.go b/internal/nodes/http_request_health_check.go index 1041351..da30dc6 100644 --- a/internal/nodes/http_request_health_check.go +++ b/internal/nodes/http_request_health_check.go @@ -9,7 +9,7 @@ import ( ) // 健康检查 -func (this *HTTPRequest) doHealthCheck(key string) (stop bool) { +func (this *HTTPRequest) doHealthCheck(key string, isHealthCheck *bool) (stop bool) { this.tags = append(this.tags, "healthCheck") this.RawReq.Header.Del(serverconfigs.HealthCheckHeaderName) @@ -19,6 +19,7 @@ func (this *HTTPRequest) doHealthCheck(key string) (stop bool) { remotelogs.Error("HTTP_REQUEST_HEALTH_CHECK", "decode key failed: "+err.Error()) return } + *isHealthCheck = true if data.GetBool("onlyBasicRequest") { return true diff --git a/internal/nodes/http_request_uam.go b/internal/nodes/http_request_uam.go new file mode 100644 index 0000000..b635034 --- /dev/null +++ b/internal/nodes/http_request_uam.go @@ -0,0 +1,10 @@ +// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. +//go:build !plus +// +build !plus + +package nodes + +// UAM +func (this *HTTPRequest) doUAM() (block bool) { + return false +}