Merge pull request #3 from madflojo/canada

Anonymous contribution
This commit is contained in:
Benjamin Cane 2020-05-10 11:14:41 -07:00 committed by GitHub
commit 5763390413
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 5 deletions

View File

@ -19,6 +19,7 @@ package main
import (
"github.com/valyala/fasthttp"
"math/rand"
"strings"
"time"
)
@ -97,6 +98,10 @@ func buildRequest(requests []preLoadedRequest, totalPremadeRequests int) (*fasth
req.Header.SetMethod(currentReq.method)
req.SetBodyString(currentReq.body)
for i := 0; i < len(currentReq.headers); i++ {
if strings.EqualFold(currentReq.headers[i][0], "Content-type") {
req.Header.SetContentType(currentReq.headers[i][1])
continue
}
req.Header.Add(currentReq.headers[i][0], currentReq.headers[i][1])
}
return req, resp