admin/sync: escape cloud URL
This commit is contained in:
parent
11c8a56f14
commit
6329f44d42
1 changed files with 2 additions and 1 deletions
|
@ -6,6 +6,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"path"
|
"path"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/studio-b12/gowebdav"
|
"github.com/studio-b12/gowebdav"
|
||||||
)
|
)
|
||||||
|
@ -84,7 +85,7 @@ func (i CloudImporter) getFile(filename string, writer *bufio.Writer) error {
|
||||||
func (i CloudImporter) listDir(filename string) ([]string, error) {
|
func (i CloudImporter) listDir(filename string) ([]string, error) {
|
||||||
client := gowebdav.NewClient(i.baseDAV.String(), i.username, i.password)
|
client := gowebdav.NewClient(i.baseDAV.String(), i.username, i.password)
|
||||||
|
|
||||||
if files, err := client.ReadDir(filename); err != nil {
|
if files, err := client.ReadDir(strings.Replace(url.PathEscape(filename), "%2F", "/", -1)); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else {
|
} else {
|
||||||
res := make([]string, 0)
|
res := make([]string, 0)
|
||||||
|
|
Reference in a new issue