mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 20:55:28 +00:00
fix code rabbit
This commit is contained in:
parent
1a9a7563c0
commit
99914e1a32
@ -582,7 +582,7 @@ Additional documentation is available at: https://docs.nuclei.sh/getting-started
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !options.Vars.IsEmpty() {
|
if !options.Vars.IsEmpty() {
|
||||||
// Maybe we should add vars to the config file as well?
|
// Maybe we should add vars to the config file as well even if they are set via flags?
|
||||||
file, err := os.Open(cfgFile)
|
file, err := os.Open(cfgFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
gologger.Fatal().Msgf("Could not open config file: %s\n", err)
|
gologger.Fatal().Msgf("Could not open config file: %s\n", err)
|
||||||
@ -596,7 +596,8 @@ Additional documentation is available at: https://docs.nuclei.sh/getting-started
|
|||||||
|
|
||||||
variables := data["var"]
|
variables := data["var"]
|
||||||
if variables != nil {
|
if variables != nil {
|
||||||
for _, value := range variables.([]interface{}) {
|
if varSlice, ok := variables.([]interface{}); ok {
|
||||||
|
for _, value := range varSlice {
|
||||||
if strVal, ok := value.(string); ok {
|
if strVal, ok := value.(string); ok {
|
||||||
options.Vars.Set(strVal)
|
options.Vars.Set(strVal)
|
||||||
} else {
|
} else {
|
||||||
@ -606,6 +607,7 @@ Additional documentation is available at: https://docs.nuclei.sh/getting-started
|
|||||||
} else {
|
} else {
|
||||||
gologger.Warning().Msgf("No 'var' section found in config file: %s", cfgFile)
|
gologger.Warning().Msgf("No 'var' section found in config file: %s", cfgFile)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user