Skip to content

Commit

Permalink
fix Authorization
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxkad committed Feb 19, 2024
1 parent 2db1e56 commit c54ea87
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion storage_webdav.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package main

import (
"context"
"encoding/base64"
"errors"
"fmt"
"io"
Expand Down Expand Up @@ -149,7 +150,9 @@ func (s *WebDavStorage) Init(ctx context.Context) (err error) {
s.opt.fullEndPoint = s.opt.EndPoint
}

s.cli = gowebdav.NewClient(s.opt.GetEndPoint(), s.opt.GetUsername(), s.opt.GetPassword())
s.cli = gowebdav.NewAuthClient(s.opt.GetEndPoint(), gowebdav.NewEmptyAuth())
s.cli.SetHeader("Authorization", "Basic "+
base64.StdEncoding.EncodeToString(([]byte)(s.opt.GetUsername()+":"+s.opt.GetPassword())))
s.cli.SetHeader("User-Agent", ClusterUserAgentFull)

if err := s.cli.Mkdir("measure", 0755); err != nil {
Expand Down

0 comments on commit c54ea87

Please sign in to comment.