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

Commit

Permalink
Merge pull request #43 from albertogviana/user-agent
Browse files Browse the repository at this point in the history
Using the user-agent informed for the user
  • Loading branch information
matiaskorhonen authored Oct 6, 2016
2 parents ebab2e6 + 302d3c6 commit db0c233
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 db0c233

Please sign in to comment.