github.com/TeaOSLab/EdgeNode@v1.3.8/internal/waf/checkpoints/request_host_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 TestRequestHostCheckpoint_RequestValue(t *testing.T) { 10 rawReq, err := http.NewRequest(http.MethodGet, "https://teaos.cn/?name=lu", nil) 11 if err != nil { 12 t.Fatal(err) 13 } 14 15 req := requests.NewTestRequest(rawReq) 16 req.WAFRaw().Header.Set("Host", "cloud.teaos.cn") 17 18 checkpoint := new(RequestHostCheckpoint) 19 t.Log(checkpoint.RequestValue(req, "", nil, 1)) 20 }