n9e-server support basic auth for Reader

master
Ulric Qin 3 years ago
parent f3924dab5b
commit e5d7612af9

@ -921,6 +921,10 @@ func (h *apiClientImpl) URL(ep string, args map[string]string) *url.URL {
}
func (h *apiClientImpl) Do(ctx context.Context, req *http.Request) (*http.Response, []byte, Warnings, error) {
if Reader.Opts.BasicAuthUser != "" && Reader.Opts.BasicAuthPass != "" {
req.SetBasicAuth(Reader.Opts.BasicAuthUser, Reader.Opts.BasicAuthPass)
}
resp, body, err := h.client.Do(ctx, req)
if err != nil {
return resp, body, nil, err

Loading…
Cancel
Save