From cdd3f19537e4cbdfaf2ffd4959aca12177948009 Mon Sep 17 00:00:00 2001 From: psyhomb Date: Thu, 24 Mar 2022 09:18:26 +0100 Subject: [PATCH] Fix: Prevent Authorization header removal --- hey.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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,