Fixed stats calculation for payloads in http base request

dev
Ice3man 2022-01-17 03:33:10 +05:30
parent 4421202bc1
commit bd7f32d92f
2 changed files with 8 additions and 2 deletions

View File

@ -346,7 +346,7 @@ func (r *Runner) RunEnumeration() error {
if len(t.Workflows) > 0 {
continue
}
totalRequests += int64(t.TotalRequests) * r.hmapInputProvider.Count()
totalRequests += int64(t.Executer.Requests()) * r.hmapInputProvider.Count()
}
if totalRequests < unclusteredRequests {
gologger.Info().Msgf("Templates clustered: %d (Reduced %d HTTP Requests)", clusterCount, unclusteredRequests-totalRequests)

View File

@ -298,7 +298,13 @@ func (request *Request) Compile(options *protocols.ExecuterOptions) error {
// Requests returns the total number of requests the YAML rule will perform
func (request *Request) Requests() int {
if request.generator != nil {
payloadRequests := request.generator.NewIterator().Total() * len(request.Raw)
payloadRequests := request.generator.NewIterator().Total()
if len(request.Raw) > 0 {
payloadRequests = payloadRequests * len(request.Raw)
}
if len(request.Path) > 0 {
payloadRequests = payloadRequests * len(request.Path)
}
return payloadRequests
}
if len(request.Raw) > 0 {