From f78789972542aadbd4bd305ef530e3651feacb69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Fri, 29 Dec 2023 16:12:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96cfg=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- middleware/access_log.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/middleware/access_log.go b/middleware/access_log.go index 129498f..6d89e43 100644 --- a/middleware/access_log.go +++ b/middleware/access_log.go @@ -32,6 +32,15 @@ func fillCfg(cfg *AccessConfig) { if nil == cfg.ExtraFieldList { 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) }