github.com/TeaOSLab/EdgeNode@v1.3.8/internal/waf/checkpoints/request_url.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 RequestURLCheckpoint struct { 10 Checkpoint 11 } 12 13 func (this *RequestURLCheckpoint) RequestValue(req requests.Request, param string, options maps.Map, ruleId int64) (value any, hasRequestBody bool, sysErr error, userErr error) { 14 return req.Format("${requestURL}"), hasRequestBody, nil, nil 15 } 16 17 func (this *RequestURLCheckpoint) 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 *RequestURLCheckpoint) CacheLife() utils.CacheLife { 25 return utils.CacheShortLife 26 }