mirror of
https://github.com/americanexpress/baton.git
synced 2025-11-23 22:15:59 +00:00
commit
5763390413
@ -19,6 +19,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"github.com/valyala/fasthttp"
|
"github.com/valyala/fasthttp"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -97,6 +98,10 @@ func buildRequest(requests []preLoadedRequest, totalPremadeRequests int) (*fasth
|
|||||||
req.Header.SetMethod(currentReq.method)
|
req.Header.SetMethod(currentReq.method)
|
||||||
req.SetBodyString(currentReq.body)
|
req.SetBodyString(currentReq.body)
|
||||||
for i := 0; i < len(currentReq.headers); i++ {
|
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])
|
req.Header.Add(currentReq.headers[i][0], currentReq.headers[i][1])
|
||||||
}
|
}
|
||||||
return req, resp
|
return req, resp
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user