github.com/TeaOSLab/EdgeNode@v1.3.8/internal/waf/checkpoints/request_arg_test.go (about) 1 package checkpoints 2 3 import ( 4 "github.com/TeaOSLab/EdgeNode/internal/waf/requests" 5 "net/http" 6 "testing" 7 ) 8 9 func TestArgParam_RequestValue(t *testing.T) { 10 rawReq, err := http.NewRequest(http.MethodGet, "http://teaos.cn/?name=lu", nil) 11 if err != nil { 12 t.Fatal(err) 13 } 14 15 req := requests.NewTestRequest(rawReq) 16 17 checkpoint := new(RequestArgCheckpoint) 18 t.Log(checkpoint.RequestValue(req, "name", nil, 1)) 19 t.Log(checkpoint.ResponseValue(req, nil, "name", nil, 1)) 20 t.Log(checkpoint.RequestValue(req, "name2", nil, 1)) 21 }