mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-12-30 18:16:39 +08:00
优化WAF正则表达式缓存时间
This commit is contained in:
@@ -3,12 +3,12 @@ package checkpoints
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeNode/internal/utils/counters"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/utils"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
"regexp"
|
||||
)
|
||||
|
||||
|
||||
// CCCheckpoint ${cc.arg}
|
||||
// TODO implement more traffic rules
|
||||
type CCCheckpoint struct {
|
||||
@@ -23,7 +23,7 @@ func (this *CCCheckpoint) Start() {
|
||||
|
||||
}
|
||||
|
||||
func (this *CCCheckpoint) RequestValue(req requests.Request, param string, options maps.Map, ruleId int64) (value interface{}, hasRequestBody bool, sysErr error, userErr error) {
|
||||
func (this *CCCheckpoint) RequestValue(req requests.Request, param string, options maps.Map, ruleId int64) (value any, hasRequestBody bool, sysErr error, userErr error) {
|
||||
value = 0
|
||||
|
||||
periodString, ok := options["period"]
|
||||
@@ -103,7 +103,7 @@ func (this *CCCheckpoint) RequestValue(req requests.Request, param string, optio
|
||||
return
|
||||
}
|
||||
|
||||
func (this *CCCheckpoint) ResponseValue(req requests.Request, resp *requests.Response, param string, options maps.Map, ruleId int64) (value interface{}, hasRequestBody bool, sysErr error, userErr error) {
|
||||
func (this *CCCheckpoint) ResponseValue(req requests.Request, resp *requests.Response, param string, options maps.Map, ruleId int64) (value any, hasRequestBody bool, sysErr error, userErr error) {
|
||||
if this.IsRequest() {
|
||||
return this.RequestValue(req, param, options, ruleId)
|
||||
}
|
||||
@@ -188,3 +188,7 @@ func (this *CCCheckpoint) Options() []OptionInterface {
|
||||
func (this *CCCheckpoint) Stop() {
|
||||
|
||||
}
|
||||
|
||||
func (this *CCCheckpoint) CacheLife() utils.CacheLife {
|
||||
return utils.CacheDisabled
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user