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

Function BenchmarkDetectXSS_HIT

internal/waf/injectionutils/utils_xss_test.go:81–94  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

79}
80
81func BenchmarkDetectXSS_HIT(b *testing.B) {
82 var result = injectionutils.DetectXSS("<html><body><span>RequestId: 1234567890</span><script src=\"\"></script></body></html>", false)
83 if !result {
84 b.Fatal("'result' should not be 'false'")
85 }
86
87 runtime.GOMAXPROCS(4)
88
89 b.RunParallel(func(pb *testing.PB) {
90 for pb.Next() {
91 _ = injectionutils.DetectXSS("<html><body><span>RequestId: 1234567890</span><script src=\"\"></script></body></html>", false)
92 }
93 })
94}

Callers

nothing calls this directly

Calls 2

DetectXSSFunction · 0.92
NextMethod · 0.80

Tested by

no test coverage detected