From 1bb4a2568af4b5571bdc898b6b8aba9ba8e55a22 Mon Sep 17 00:00:00 2001 From: Ice3man543 Date: Tue, 29 Dec 2020 19:35:16 +0530 Subject: [PATCH] Fixed panic in http executer --- v2/pkg/protocols/http/http.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/v2/pkg/protocols/http/http.go b/v2/pkg/protocols/http/http.go index c54ea92fb..0d354a065 100644 --- a/v2/pkg/protocols/http/http.go +++ b/v2/pkg/protocols/http/http.go @@ -109,9 +109,12 @@ func (r *Request) Compile(options *protocols.ExecuterOptions) error { // Requests returns the total number of requests the YAML rule will perform func (r *Request) Requests() int { - if len(r.Payloads) > 0 { + if r.generator != nil { payloadRequests := r.generator.NewIterator().Total() return len(r.Raw) * payloadRequests } + if len(r.Raw) > 0 { + return len(r.Raw) + } return len(r.Path) }