Skip to content

armgit / hey

Public Imported from GitHub
0

HTTP load generator, ApacheBench (ab) replacement

Go

Use existing serverName variable

Mat Evans6654173e1cab
diff --git a/boom.go b/boom.go
index 3bfdc3d..cd241cc 100644
--- a/boom.go
+++ b/boom.go
@@ -151,7 +151,6 @@ func main() {
Url: url,
Body: *flagD,
Header: header,
- Host: serverName,
Username: username,
Password: password,
ServerName: serverName,
diff --git a/commands/boom.go b/commands/boom.go
index 859d96b..6bf8347 100644
--- a/commands/boom.go
+++ b/commands/boom.go
@@ -33,7 +33,6 @@ type ReqOpts struct {
Method string
Url string
Header http.Header
- Host string
Body string
Username string
Password string
@@ -48,7 +47,7 @@ func (r *ReqOpts) Request() *http.Request {
req.Header = r.Header
// update the Host value in the Request - this is used as the host header in any subsequent request
- req.Host = r.Host
+ req.Host = r.ServerName
if r.Username != "" && r.Password != "" {
req.SetBasicAuth(r.Username, r.Password)