mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-03 23:20:25 +08:00
27 lines
865 B
Go
27 lines
865 B
Go
package checkpoints
|
|
|
|
import (
|
|
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
|
"github.com/TeaOSLab/EdgeNode/internal/waf/utils"
|
|
"github.com/iwind/TeaGo/maps"
|
|
)
|
|
|
|
type RequestArgCheckpoint struct {
|
|
Checkpoint
|
|
}
|
|
|
|
func (this *RequestArgCheckpoint) RequestValue(req requests.Request, param string, options maps.Map, ruleId int64) (value any, hasRequestBody bool, sysErr error, userErr error) {
|
|
return req.WAFRaw().URL.Query().Get(param), hasRequestBody, nil, nil
|
|
}
|
|
|
|
func (this *RequestArgCheckpoint) 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)
|
|
}
|
|
return
|
|
}
|
|
|
|
func (this *RequestArgCheckpoint) CacheLife() utils.CacheLife {
|
|
return utils.CacheMiddleLife
|
|
}
|