mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-27 10:42:36 +01:00
feature (dav): support for servers who have the username in their URL - #418
In the URL parameters for DAV backends (WebDAV and CalDAV/CardDAV) the
%{username} string is interpolated to the URL encoded username. It
shouldn't conflict with legitimate URLS as %{ is not a valid URL escape
sequence.
This is needed for some servers where the URL contains the username
such as Cyrus IMAP.
This commit is contained in:
parent
a91df1637d
commit
cf827673c0
2 changed files with 2 additions and 2 deletions
|
|
@ -41,7 +41,7 @@ func (this Dav) Init(params map[string]string, app *App) (IBackend, error) {
|
|||
return backend, nil
|
||||
}
|
||||
backend := Dav{
|
||||
url: params["url"],
|
||||
url: strings.ReplaceAll(params["url"], "%{username}", url.PathEscape(params["username"])),
|
||||
which: params["type"],
|
||||
params: params,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ func (w WebDav) Init(params map[string]string, app *App) (IBackend, error) {
|
|||
}
|
||||
backend := WebDav{
|
||||
params: &WebDavParams{
|
||||
params["url"],
|
||||
strings.ReplaceAll(params["url"], "%{username}", url.PathEscape(params["username"])),
|
||||
params["username"],
|
||||
params["password"],
|
||||
params["path"],
|
||||
|
|
|
|||
Loading…
Reference in a new issue