From 997a7c126a85990e2279894e2218ee81ecbfe160 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Mon, 25 Jan 2021 15:11:21 +0100 Subject: [PATCH] WebDAV: Improve service discovery #496 --- frontend/src/dialog/account/add.vue | 2 +- internal/remote/heuristic.go | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/frontend/src/dialog/account/add.vue b/frontend/src/dialog/account/add.vue index d8d8bb82e..862c9d94a 100644 --- a/frontend/src/dialog/account/add.vue +++ b/frontend/src/dialog/account/add.vue @@ -52,7 +52,7 @@ @click.stop="cancel"> {{ label.cancel }} - {{ label.confirm }} diff --git a/internal/remote/heuristic.go b/internal/remote/heuristic.go index cc1386876..a597b4edd 100644 --- a/internal/remote/heuristic.go +++ b/internal/remote/heuristic.go @@ -23,7 +23,7 @@ var Heuristics = []Heuristic{ {ServiceOneDrive, []string{"onedrive.live.com"}, []string{}, "GET"}, {ServiceGDrive, []string{"drive.google.com"}, []string{}, "GET"}, {ServiceGPhotos, []string{"photos.google.com"}, []string{}, "GET"}, - {ServiceWebDAV, []string{}, []string{"/", "/webdav", "/remote.php/dav/files/{user}", "/remote.php/webdav", "/dav/files/{user}", "/servlet/webdav.infostore/"}, "PROPFIND"}, + {ServiceWebDAV, []string{}, []string{"/", "/webdav/", "/remote.php/dav/files/{user}/", "/remote.php/webdav/", "/dav/files/{user}/", "/servlet/webdav.infostore/"}, "PROPFIND"}, } func (h Heuristic) MatchDomain(match string) bool { @@ -52,8 +52,7 @@ func (h Heuristic) Discover(rawUrl, user string) *url.URL { } for _, p := range h.Paths { - strings.Replace(p, "{user}", user, -1) - u.Path = p + u.Path = strings.Replace(p, "{user}", user, -1) if HttpOk(h.Method, u.String()) { return u