From 391cb530faa1b3c1739c6b6835a324de63a91dbd Mon Sep 17 00:00:00 2001 From: Douglas Danger Manley Date: Sat, 27 Jul 2024 10:03:41 -0400 Subject: [PATCH] Tweak validation --- pkg/protocols/common/generators/validate.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/protocols/common/generators/validate.go b/pkg/protocols/common/generators/validate.go index adb537d289..0aa0737149 100644 --- a/pkg/protocols/common/generators/validate.go +++ b/pkg/protocols/common/generators/validate.go @@ -22,6 +22,13 @@ func (g *PayloadGenerator) validate(payloads map[string]interface{}, templatePat return errors.New("invalid number of lines in payload") } + // For historical reasons, "validate" checks to see if the payload file exist. + // If we're using a custom helper function, then we need to skip any validation beyond just checking the string syntax. + // Actually attempting to load the file will determine whether or not it exists. + if g.options.LoadHelperFileFunction != nil { + return nil + } + // check if it's a file and try to load it if fileutil.FileExists(payloadType) { continue