Fix sending of basic auth credentials in http output (#4609)

This commit is contained in:
Daniel Nelson
2018-08-29 12:28:29 -07:00
committed by GitHub
parent 8b2d64585d
commit 7b05993a6e
2 changed files with 8 additions and 6 deletions

View File

@@ -235,10 +235,8 @@ func TestBasicAuth(t *testing.T) {
require.NoError(t, err)
tests := []struct {
name string
plugin *HTTP
username string
password string
name string
plugin *HTTP
}{
{
name: "default",
@@ -274,8 +272,8 @@ func TestBasicAuth(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
ts.Config.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
username, password, _ := r.BasicAuth()
require.Equal(t, tt.username, username)
require.Equal(t, tt.password, password)
require.Equal(t, tt.plugin.Username, username)
require.Equal(t, tt.plugin.Password, password)
w.WriteHeader(http.StatusOK)
})