Skip to content
This repository has been archived by the owner on Aug 17, 2020. It is now read-only.

Commit

Permalink
Using the user-agent informed for the user
Browse files Browse the repository at this point in the history
  • Loading branch information
albertogviana committed Oct 1, 2016
1 parent cd2fa1f commit 302d3c6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lambda/lambda.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, ":")
Expand All @@ -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
Expand Down

0 comments on commit 302d3c6

Please sign in to comment.