mirror of
https://github.com/1f349/go-webdav.git
synced 2024-12-22 08:14:15 +00:00
internal: prevent empty endpoint path from resulting in "." sub-paths
This commit is contained in:
parent
842acb3647
commit
7d0d522fa7
@ -27,6 +27,10 @@ func NewClient(c *http.Client, endpoint string) (*Client, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if u.Path == "" {
|
||||
// This is important to avoid issues with path.Join
|
||||
u.Path = "/"
|
||||
}
|
||||
return &Client{http: c, endpoint: u}, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user