From e7aa309eeaa79ffe275b5010520fd1329aeb0990 Mon Sep 17 00:00:00 2001 From: osxtest <38131934+osxtest@users.noreply.github.com> Date: Mon, 23 Sep 2024 09:47:46 +0800 Subject: [PATCH] Fix duplicate parameter key concatenation in smart filter --- pkg/filter/smart_filter.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/filter/smart_filter.go b/pkg/filter/smart_filter.go index a8c21cf..abe336e 100755 --- a/pkg/filter/smart_filter.go +++ b/pkg/filter/smart_filter.go @@ -392,17 +392,17 @@ func MarkPath(path string) string { 全局数值型参数过滤 */ func (s *SmartFilter) globalFilterLocationMark(req *model.Request) { - name := req.URL.Hostname() + req.URL.Path + req.Method + base := req.URL.Hostname() + req.URL.Path + req.Method if req.Method == config.GET || req.Method == config.DELETE || req.Method == config.HEAD || req.Method == config.OPTIONS { for key := range req.Filter.MarkedQueryMap { - name += key + name := base + key if s.filterLocationSet.Contains(name) { req.Filter.MarkedQueryMap[key] = CustomValueMark } } } else if req.Method == config.POST || req.Method == config.PUT { for key := range req.Filter.MarkedPostDataMap { - name += key + name := base + key if s.filterLocationSet.Contains(name) { req.Filter.MarkedPostDataMap[key] = CustomValueMark }