From 159e0304c5e00a45542e3543d2b0bc8df59bce76 Mon Sep 17 00:00:00 2001 From: andig Date: Sun, 2 Jan 2022 16:17:02 +0100 Subject: [PATCH] Add missing auth settings --- provider/http.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/provider/http.go b/provider/http.go index c01b18262..fe10d16db 100644 --- a/provider/http.go +++ b/provider/http.go @@ -71,10 +71,17 @@ func NewHTTPProviderFromConfig(other map[string]interface{}) (IntProvider, error WithHeaders(cc.Headers). WithBody(cc.Body) - pipe, err := pipeline.New(cc.Settings) + http.Client.Timeout = cc.Timeout + + var err error + if cc.Auth.Type != "" { + _, err = http.WithAuth(cc.Auth.Type, cc.Auth.User, cc.Auth.Password) + } + if err == nil { + var pipe *pipeline.Pipeline + pipe, err = pipeline.New(cc.Settings) http = http.WithPipeline(pipe) - http.Client.Timeout = cc.Timeout } return http, err