From ceceda22a68cfecef62062fcd8fbcb80c3de67fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Wed, 5 Jul 2023 15:29:04 +0800 Subject: [PATCH] =?UTF-8?q?=E2=80=9C=E9=9B=86=E7=BE=A4=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=20--=20=E7=BD=91=E7=AB=99=E8=AE=BE=E7=BD=AE=E2=80=9D=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E2=80=9C=E5=85=81=E8=AE=B8=E8=AE=B0=E5=BD=95=E8=AE=BF?= =?UTF-8?q?=E9=97=AE=E6=97=A5=E5=BF=97=E2=80=9D=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/serverconfigs/global_server_config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/serverconfigs/global_server_config.go b/pkg/serverconfigs/global_server_config.go index 70497db..7364570 100644 --- a/pkg/serverconfigs/global_server_config.go +++ b/pkg/serverconfigs/global_server_config.go @@ -2,10 +2,11 @@ package serverconfigs -func DefaultGlobalServerConfig() *GlobalServerConfig { +func NewGlobalServerConfig() *GlobalServerConfig { var config = &GlobalServerConfig{} config.HTTPAll.SupportsLowVersionHTTP = true + config.HTTPAccessLog.IsOn = true config.HTTPAccessLog.EnableRequestHeaders = true config.HTTPAccessLog.EnableResponseHeaders = true config.HTTPAccessLog.EnableCookies = true @@ -40,6 +41,7 @@ type GlobalServerConfig struct { } `yaml:"httpAll" json:"httpAll"` // HTTP统一配置 HTTPAccessLog struct { + IsOn bool `yaml:"isOn" json:"isOn"` // 是否启用此功能 EnableRequestHeaders bool `yaml:"enableRequestHeaders" json:"enableRequestHeaders"` // 记录请求Header CommonRequestHeadersOnly bool `yaml:"commonRequestHeadersOnly" json:"commonRequestHeadersOnly"` // 只保留通用Header EnableResponseHeaders bool `yaml:"enableResponseHeaders" json:"enableResponseHeaders"` // 记录响应Header