github.com/TeaOSLab/EdgeNode@v1.3.8/internal/waf/checkpoints/request_path.go (about) 1 package checkpoints 2 3 import ( 4 "github.com/TeaOSLab/EdgeNode/internal/waf/requests" 5 "github.com/TeaOSLab/EdgeNode/internal/waf/utils" 6 "github.com/iwind/TeaGo/maps" 7 ) 8 9 type RequestPathCheckpoint struct { 10 Checkpoint 11 } 12 13 func (this *RequestPathCheckpoint) RequestValue(req requests.Request, param string, options maps.Map, ruleId int64) (value any, hasRequestBody bool, sysErr error, userErr error) { 14 return req.WAFRaw().URL.Path, false, nil, nil 15 } 16 17 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) { 18 if this.IsRequest() { 19 return this.RequestValue(req, param, options, ruleId) 20 } 21 return 22 } 23 24 func (this *RequestPathCheckpoint) CacheLife() utils.CacheLife { 25 return utils.CacheMiddleLife 26 }