mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-23 07:00:25 +08:00
集群服务设置--访问日志中可以设置是否只记录通用Header
This commit is contained in:
@@ -62,7 +62,13 @@ func (this *HTTPRequest) log() {
|
||||
// 请求Header
|
||||
var pbReqHeader = map[string]*pb.Strings{}
|
||||
if ref == nil || ref.ContainsField(serverconfigs.HTTPAccessLogFieldHeader) {
|
||||
// 是否只记录通用Header
|
||||
var commonHeadersOnly = this.nodeConfig != nil && this.nodeConfig.GlobalServerConfig != nil && this.nodeConfig.GlobalServerConfig.HTTPAccessLog.CommonRequestHeadersOnly
|
||||
|
||||
for k, v := range this.RawReq.Header {
|
||||
if commonHeadersOnly && !serverconfigs.IsCommonRequestHeader(k) {
|
||||
continue
|
||||
}
|
||||
pbReqHeader[k] = &pb.Strings{Values: v}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user