Skip to content

Commit

Permalink
Add missing auth settings
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Jan 2, 2022
1 parent 94b8897 commit 159e030
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions provider/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 159e030

Please sign in to comment.