Files
EdgeNode/internal/waf/checkpoints/request_path.go

22 lines
713 B
Go
Raw Normal View History

2020-10-08 15:06:42 +08:00
package checkpoints
import (
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
"github.com/iwind/TeaGo/maps"
2020-10-08 15:06:42 +08:00
)
type RequestPathCheckpoint struct {
Checkpoint
}
func (this *RequestPathCheckpoint) RequestValue(req requests.Request, param string, options maps.Map, ruleId int64) (value interface{}, hasRequestBody bool, sysErr error, userErr error) {
2022-07-16 17:05:37 +08:00
return req.WAFRaw().URL.Path, false, nil, nil
2020-10-08 15:06:42 +08:00
}
func (this *RequestPathCheckpoint) ResponseValue(req requests.Request, resp *requests.Response, param string, options maps.Map, ruleId int64) (value interface{}, hasRequestBody bool, sysErr error, userErr error) {
2020-10-08 15:06:42 +08:00
if this.IsRequest() {
return this.RequestValue(req, param, options, ruleId)
2020-10-08 15:06:42 +08:00
}
return
}