internal: backend: sftp: support user@domain parsing as user

This commit is contained in:
streambinder
2019-09-26 12:23:31 +02:00
parent 72bd467e23
commit 97e5ce4344
2 changed files with 12 additions and 3 deletions

View File

@@ -56,8 +56,11 @@ func ParseConfig(s string) (interface{}, error) {
host = data[0]
dir = data[1]
// split user and host at the "@"
data = strings.SplitN(host, "@", 2)
if len(data) == 2 {
data = strings.SplitN(host, "@", 3)
if len(data) == 3 {
user = data[0] + "@" + data[1]
host = data[2]
} else if len(data) == 2 {
user = data[0]
host = data[1]
}