mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-26 19:38:48 +01:00
✨ 数据同步支持接入第三方 WebDAV 服务 https://github.com/siyuan-note/siyuan/issues/6446
This commit is contained in:
parent
d7f6456424
commit
b6a1512105
6 changed files with 87 additions and 30 deletions
|
|
@ -159,3 +159,17 @@ func GetChildDocDepth(treeAbsPath string) (ret int) {
|
|||
ret = depth - baseDepth
|
||||
return
|
||||
}
|
||||
|
||||
func NormalizeEndpoint(endpoint string) string {
|
||||
endpoint = strings.TrimSpace(endpoint)
|
||||
if "" == endpoint {
|
||||
return ""
|
||||
}
|
||||
if !strings.HasPrefix(endpoint, "http://") && !strings.HasPrefix(endpoint, "https://") {
|
||||
endpoint = "http://" + endpoint
|
||||
}
|
||||
if !strings.HasSuffix(endpoint, "/") {
|
||||
endpoint = endpoint + "/"
|
||||
}
|
||||
return endpoint
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue