Add Authenticator interface and Digest auth support

This commit is contained in:
David
2018-05-25 22:40:13 +02:00
committed by Christoph Polcin
parent 5bedad6f1e
commit 6d8c168f72
4 changed files with 166 additions and 13 deletions
+3
View File
@@ -12,12 +12,15 @@ func (c *Client) req(method, path string, body io.Reader, intercept func(*http.R
if err != nil {
return nil, err
}
for k, vals := range c.headers {
for _, v := range vals {
r.Header.Add(k, v)
}
}
c.auth.Authorize(c, method, path)
if intercept != nil {
intercept(r)
}