github.com/TeaOSLab/EdgeNode@v1.3.8/internal/nodes/http_request_health_check.go (about)

     1  // Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
     2  
     3  package nodes
     4  
     5  import (
     6  	"github.com/TeaOSLab/EdgeCommon/pkg/nodeutils"
     7  	"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
     8  	"github.com/TeaOSLab/EdgeNode/internal/remotelogs"
     9  )
    10  
    11  // 健康检查
    12  func (this *HTTPRequest) doHealthCheck(key string, isHealthCheck *bool) (stop bool) {
    13  	this.tags = append(this.tags, "healthCheck")
    14  
    15  	this.RawReq.Header.Del(serverconfigs.HealthCheckHeaderName)
    16  
    17  	data, err := nodeutils.Base64DecodeMap(key)
    18  	if err != nil {
    19  		remotelogs.Error("HTTP_REQUEST_HEALTH_CHECK", "decode key failed: "+err.Error())
    20  		return
    21  	}
    22  	*isHealthCheck = true
    23  
    24  	this.web.StatRef = nil
    25  
    26  	if !data.GetBool("accessLogIsOn") {
    27  		this.disableLog = true
    28  	}
    29  
    30  	if data.GetBool("onlyBasicRequest") {
    31  		return true
    32  	}
    33  
    34  	return
    35  }