feat: webdav handle

This commit is contained in:
Noah Hsu
2022-06-30 22:41:55 +08:00
parent dd013ac0b2
commit 2b1726614b
11 changed files with 344 additions and 3451 deletions

View File

@ -10,8 +10,12 @@ import (
func GetBaseUrl(r *http.Request) string {
baseUrl := setting.GetByKey(conf.BaseUrl)
protocol := "http"
if r.TLS != nil {
protocol = "https"
}
if baseUrl == "" {
baseUrl = fmt.Sprintf("//%s", r.Host)
baseUrl = fmt.Sprintf("%s//%s", protocol, r.Host)
}
strings.TrimSuffix(baseUrl, "/")
return baseUrl