mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2026-01-31 15:53:10 +08:00
log failed expr compilations
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/Knetic/govaluate"
|
||||
"github.com/projectdiscovery/gologger"
|
||||
|
||||
"github.com/projectdiscovery/nuclei/v3/pkg/operators/common/dsl"
|
||||
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/marker"
|
||||
@@ -56,10 +57,12 @@ func evaluate(data string, base map[string]interface{}) (string, error) {
|
||||
// turns expressions (either helper functions+base values or base values)
|
||||
compiled, err := govaluate.NewEvaluableExpressionWithFunctions(expression, dsl.HelperFunctions)
|
||||
if err != nil {
|
||||
gologger.Warning().Msgf("Failed to compile expression '%s': %v", expression, err)
|
||||
continue
|
||||
}
|
||||
result, err := compiled.Evaluate(base)
|
||||
if err != nil {
|
||||
gologger.Warning().Msgf("Failed to evaluate expression '%s': %v", expression, err)
|
||||
continue
|
||||
}
|
||||
// replace incrementally
|
||||
|
||||
Reference in New Issue
Block a user