Some refactorings

This commit is contained in:
Deluan
2023-03-26 21:26:55 -04:00
parent 05d381c26f
commit b998c05ca0
5 changed files with 66 additions and 43 deletions
+1 -1
View File
@@ -171,7 +171,7 @@ func AbsoluteURL(r *http.Request, u string, params url.Values) string {
if strings.HasPrefix(u, "/") {
buildUrl.Path = path.Join(conf.Server.BasePath, buildUrl.Path)
if conf.Server.BaseHost != "" {
buildUrl.Scheme = IfZero(conf.Server.BaseScheme, "http")
buildUrl.Scheme = If(conf.Server.BaseScheme, "http")
buildUrl.Host = conf.Server.BaseHost
} else {
buildUrl.Scheme = r.URL.Scheme