健康检查支持UserAgent和是否基础请求设置

This commit is contained in:
刘祥超
2021-10-19 16:31:27 +08:00
parent 2793e0de89
commit 16349041fb
2 changed files with 35 additions and 0 deletions

View File

@@ -177,6 +177,14 @@ func (this *HTTPRequest) doBegin() {
}
}
// 处理健康检查
var healthCheckKey = this.RawReq.Header.Get(serverconfigs.HealthCheckHeaderName)
if len(healthCheckKey) > 0 {
if this.doHealthCheck(healthCheckKey) {
return
}
}
// 统计
if this.web.StatRef != nil && this.web.StatRef.IsOn {
this.doStat()