From 2ee270f2746e2c8b591b0c9e2931f084a6f66ae3 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Thu, 15 Feb 2018 18:22:49 -0800 Subject: [PATCH] Allow setting basic auth with empty username --- plugins/inputs/http/http.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/inputs/http/http.go b/plugins/inputs/http/http.go index beece0458..1f6a2e924 100644 --- a/plugins/inputs/http/http.go +++ b/plugins/inputs/http/http.go @@ -150,7 +150,7 @@ func (h *HTTP) gatherURL( } } - if h.Username != "" { + if h.Username != "" || h.Password != "" { request.SetBasicAuth(h.Username, h.Password) }