mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-12 06:10:25 +08:00
人机识别增加UA记录
This commit is contained in:
@@ -6,7 +6,10 @@ import (
|
||||
"github.com/TeaOSLab/EdgeNode/internal/ttlcache"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/utils/cachehits"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/utils/fasttime"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"github.com/cespare/xxhash"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
stringutil "github.com/iwind/TeaGo/utils/string"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
@@ -95,3 +98,8 @@ func MatchBytesCache(regex *re.Regexp, byteSlice []byte, cacheLife CacheLife) bo
|
||||
cacheHits.IncreaseCached(regIdString)
|
||||
return b
|
||||
}
|
||||
|
||||
// ComposeIPType 组合IP类型
|
||||
func ComposeIPType(setId int64, req requests.Request) string {
|
||||
return "set:" + types.String(setId) + "@" + stringutil.Md5(req.WAFRaw().UserAgent())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user