From 027ff4e2dd5df44655d6c3a96ee30c2bf09832e2 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) }