mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-06 18:10:26 +08:00
27 lines
846 B
Go
27 lines
846 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 RequestPathCheckpoint struct {
|
|
Checkpoint
|
|
}
|
|
|
|
func (this *RequestPathCheckpoint) RequestValue(req requests.Request, param string, options maps.Map, ruleId int64) (value any, hasRequestBody bool, sysErr error, userErr error) {
|
|
return req.WAFRaw().URL.Path, false, nil, nil
|
|
}
|
|
|
|
func (this *RequestPathCheckpoint) 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 *RequestPathCheckpoint) CacheLife() utils.CacheLife {
|
|
return utils.CacheMiddleLife
|
|
}
|