Introduce HTTPClient, remove Client.SetBasicAuth

This commit is contained in:
Simon Ser
2020-02-19 16:02:49 +01:00
parent c52097fefb
commit ddf2a85958
4 changed files with 37 additions and 31 deletions

View File

@@ -55,7 +55,7 @@ type Client struct {
ic *internal.Client
}
func NewClient(c *http.Client, endpoint string) (*Client, error) {
func NewClient(c webdav.HTTPClient, endpoint string) (*Client, error) {
wc, err := webdav.NewClient(c, endpoint)
if err != nil {
return nil, err
@@ -67,11 +67,6 @@ func NewClient(c *http.Client, endpoint string) (*Client, error) {
return &Client{wc, ic}, nil
}
func (c *Client) SetBasicAuth(username, password string) {
c.Client.SetBasicAuth(username, password)
c.ic.SetBasicAuth(username, password)
}
func (c *Client) HasSupport() error {
classes, _, err := c.ic.Options("")
if err != nil {