优化cfg初始化

This commit is contained in:
白茶清欢 2023-12-29 16:12:33 +08:00
parent 80ce64f8e1
commit f787899725

View File

@ -32,6 +32,15 @@ func fillCfg(cfg *AccessConfig) {
if nil == cfg.ExtraFieldList { if nil == cfg.ExtraFieldList {
cfg.ExtraFieldList = make([]string, 0) cfg.ExtraFieldList = make([]string, 0)
} }
if nil == cfg.RequestHeaderList {
cfg.RequestHeaderList = make([]string, 0)
}
if nil == cfg.ResponseHeaderList {
cfg.ResponseHeaderList = make([]string, 0)
}
if nil == cfg.ExtraFieldList {
cfg.ExtraFieldList = make([]string, 0)
}
cfg.ExtraFieldList = append(cfg.ExtraFieldList, define.RecordRequestDataField, define.RecordResponseDataField) cfg.ExtraFieldList = append(cfg.ExtraFieldList, define.RecordRequestDataField, define.RecordResponseDataField)
} }