Skip to content

Commit

Permalink
Add vars with SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
alban-stourbe-wmx committed Sep 30, 2024
1 parent d161485 commit d0463e8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,20 @@ func WithHeaders(headers []string) NucleiSDKOptions {
}
}

// WithVars allows setting custom variables to use in templates/workflows context
func WithVars(vars []string) NucleiSDKOptions {
// Create a goflags.RuntimeMap
runtimeVars := goflags.RuntimeMap{}
for _, v := range vars {
runtimeVars.Set(v)
}

return func(e *NucleiEngine) error {
e.opts.Vars = runtimeVars
return nil
}
}

// EnablePassiveMode allows enabling passive HTTP response processing mode
func EnablePassiveMode() NucleiSDKOptions {
return func(e *NucleiEngine) error {
Expand Down

0 comments on commit d0463e8

Please sign in to comment.