From 302d3c605fd591e84a23f2c7426037cbb167c898 Mon Sep 17 00:00:00 2001 From: Alberto Viana Date: Sat, 1 Oct 2016 20:38:48 +0200 Subject: [PATCH] Using the user-agent informed for the user --- lambda/lambda.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lambda/lambda.go b/lambda/lambda.go index 6161e147..98dffac6 100644 --- a/lambda/lambda.go +++ b/lambda/lambda.go @@ -228,7 +228,6 @@ func fetch(loadTestStartTime time.Time, client *http.Client, address string, req fmt.Println("Error creating the HTTP request:", err) return } - req.Header.Add("User-Agent", "Mozilla/5.0 (compatible; Goad/1.0; +https://goad.io)") req.Header.Add("Accept-Encoding", "gzip") for _, v := range requestHeaders { header := strings.Split(v, ":") @@ -239,6 +238,10 @@ func fetch(loadTestStartTime time.Time, client *http.Client, address string, req } } + if req.Header.Get("User-Agent") == "" { + req.Header.Add("User-Agent", "Mozilla/5.0 (compatible; Goad/1.0; +https://goad.io)") + } + response, err := client.Do(req) var status string var elapsedFirstByte time.Duration