mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 05:25:25 +00:00
fix(headless): Variables are now available into headless template (#6301)
* fix(headless): variables now available into simple headless template * chore: erase debug logs
This commit is contained in:
parent
84a76b3d4e
commit
eccd90d53c
@ -54,10 +54,11 @@ func (request *Request) ExecuteWithResults(input *contextargs.Context, metadata,
|
|||||||
optionVars := generators.BuildPayloadFromOptions(request.options.Options)
|
optionVars := generators.BuildPayloadFromOptions(request.options.Options)
|
||||||
// add templatecontext variables to varMap
|
// add templatecontext variables to varMap
|
||||||
if request.options.HasTemplateCtx(input.MetaInput) {
|
if request.options.HasTemplateCtx(input.MetaInput) {
|
||||||
vars = generators.MergeMaps(vars, metadata, optionVars, request.options.GetTemplateCtx(input.MetaInput).GetAll())
|
vars = generators.MergeMaps(vars, request.options.GetTemplateCtx(input.MetaInput).GetAll())
|
||||||
}
|
}
|
||||||
|
|
||||||
variablesMap := request.options.Variables.Evaluate(vars)
|
variablesMap := request.options.Variables.Evaluate(vars)
|
||||||
vars = generators.MergeMaps(vars, variablesMap, request.options.Constants)
|
vars = generators.MergeMaps(vars, metadata, optionVars, variablesMap, request.options.Constants)
|
||||||
|
|
||||||
// check for operator matches by wrapping callback
|
// check for operator matches by wrapping callback
|
||||||
gotmatches := false
|
gotmatches := false
|
||||||
@ -118,8 +119,8 @@ func (request *Request) executeRequestWithPayloads(input *contextargs.Context, p
|
|||||||
return errors.Wrap(err, errCouldNotGetHtmlElement)
|
return errors.Wrap(err, errCouldNotGetHtmlElement)
|
||||||
}
|
}
|
||||||
defer func() {
|
defer func() {
|
||||||
_ = instance.Close()
|
_ = instance.Close()
|
||||||
}()
|
}()
|
||||||
|
|
||||||
instance.SetInteractsh(request.options.Interactsh)
|
instance.SetInteractsh(request.options.Interactsh)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user