(a *assert.Assertion, t *testing.T, template *waf.WAF)
| 203 | } |
| 204 | |
| 205 | func testTemplate3001(a *assert.Assertion, t *testing.T, template *waf.WAF) { |
| 206 | req, err := http.NewRequest(http.MethodPost, "http://example.com/index.php?exec1+(", bytes.NewReader([]byte("exec('rm -rf /hello');"))) |
| 207 | if err != nil { |
| 208 | t.Fatal(err) |
| 209 | } |
| 210 | result, err := template.MatchRequest(requests.NewTestRequest(req), nil, firewallconfigs.ServerCaptchaTypeNone) |
| 211 | if err != nil { |
| 212 | t.Fatal(err) |
| 213 | } |
| 214 | a.IsNotNil(result.Set) |
| 215 | if result.Set != nil { |
| 216 | a.IsTrue(result.Set.Code == "3001") |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | func testTemplate4001(a *assert.Assertion, t *testing.T, template *waf.WAF) { |
| 221 | req, err := http.NewRequest(http.MethodPost, "http://example.com/index.php?whoami", nil) |
no test coverage detected