MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / testTemplate4001

Function testTemplate4001

internal/waf/template_test.go:220–233  ·  view source on GitHub ↗
(a *assert.Assertion, t *testing.T, template *waf.WAF)

Source from the content-addressed store, hash-verified

218}
219
220func testTemplate4001(a *assert.Assertion, t *testing.T, template *waf.WAF) {
221 req, err := http.NewRequest(http.MethodPost, "http://example.com/index.php?whoami", nil)
222 if err != nil {
223 t.Fatal(err)
224 }
225 result, err := template.MatchRequest(requests.NewTestRequest(req), nil, firewallconfigs.ServerCaptchaTypeNone)
226 if err != nil {
227 t.Fatal(err)
228 }
229 a.IsNotNil(result.Set)
230 if result.Set != nil {
231 a.IsTrue(result.Set.Code == "4001")
232 }
233}
234
235func testTemplate5001(a *assert.Assertion, t *testing.T, template *waf.WAF) {
236 {

Callers 1

Test_TemplateFunction · 0.85

Calls 2

NewTestRequestFunction · 0.92
MatchRequestMethod · 0.45

Tested by

no test coverage detected