From 4dfb9e878417a8fa6f074c363ce1ca36e4c64626 Mon Sep 17 00:00:00 2001 From: link-duan Date: Thu, 6 Jul 2023 17:44:35 +0800 Subject: [PATCH] fix(egin): AccessInterceptor config watch --- server/egin/container.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/egin/container.go b/server/egin/container.go index aee4728d..c21ca5cf 100644 --- a/server/egin/container.go +++ b/server/egin/container.go @@ -122,10 +122,10 @@ func (c *Container) Build(options ...Option) *Component { econf.OnChange(func(newConf *econf.Configuration) { c.config.mu.Lock() cf := newConf.Sub(c.name) - c.config.EnableAccessInterceptorReq = cf.GetBool("EnableAccessInterceptorReq") - c.config.EnableAccessInterceptorRes = cf.GetBool("EnableAccessInterceptorRes") - if c.config.AccessInterceptorReqResFilter != cf.GetString("AccessInterceptorReqResFilter") { - c.config.AccessInterceptorReqResFilter = cf.GetString("AccessInterceptorReqResFilter") + c.config.EnableAccessInterceptorReq = cf.GetBool("enableAccessInterceptorReq") + c.config.EnableAccessInterceptorRes = cf.GetBool("enableAccessInterceptorRes") + if c.config.AccessInterceptorReqResFilter != cf.GetString("accessInterceptorReqResFilter") { + c.config.AccessInterceptorReqResFilter = cf.GetString("accessInterceptorReqResFilter") if err := c.setAiReqResCelPrg(); err != nil { c.logger.Warn("init AccessInterceptorReqResFilter fail", elog.FieldErr(err), elog.String("AccessInterceptorReqResFilter", c.config.AccessInterceptorReqResFilter)) }