mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-10 20:50:25 +08:00
商业版增加UAM功能
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
10
internal/nodes/http_request_uam.go
Normal file
10
internal/nodes/http_request_uam.go
Normal file
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user