Skip to content

Commit 302d3c6

Browse files
committed
Using the user-agent informed for the user
1 parent cd2fa1f commit 302d3c6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lambda/lambda.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ func fetch(loadTestStartTime time.Time, client *http.Client, address string, req
228228
fmt.Println("Error creating the HTTP request:", err)
229229
return
230230
}
231-
req.Header.Add("User-Agent", "Mozilla/5.0 (compatible; Goad/1.0; +https://goad.io)")
232231
req.Header.Add("Accept-Encoding", "gzip")
233232
for _, v := range requestHeaders {
234233
header := strings.Split(v, ":")
@@ -239,6 +238,10 @@ func fetch(loadTestStartTime time.Time, client *http.Client, address string, req
239238
}
240239
}
241240

241+
if req.Header.Get("User-Agent") == "" {
242+
req.Header.Add("User-Agent", "Mozilla/5.0 (compatible; Goad/1.0; +https://goad.io)")
243+
}
244+
242245
response, err := client.Do(req)
243246
var status string
244247
var elapsedFirstByte time.Duration

0 commit comments

Comments
 (0)