diff --git a/hey.go b/hey.go index f727e26b..9f3a9917 100644 --- a/hey.go +++ b/hey.go @@ -196,9 +196,6 @@ func main() { usageAndExit(err.Error()) } req.ContentLength = int64(len(bodyAll)) - if username != "" || password != "" { - req.SetBasicAuth(username, password) - } // set host header if set if *hostHeader != "" { @@ -221,6 +218,10 @@ func main() { req.Header = header + if username != "" || password != "" { + req.SetBasicAuth(username, password) + } + w := &requester.Work{ Request: req, RequestBody: bodyAll,