From 7020389a757a73a9c68d881ed3543db377251d42 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Mon, 21 Aug 2023 10:29:22 +0200 Subject: [PATCH] Albums: Fix album preview image URL in auth_share.go #3658 Signed-off-by: Michael Mayer --- internal/api/auth_share.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/api/auth_share.go b/internal/api/auth_share.go index 381efed8c..4d6167b14 100644 --- a/internal/api/auth_share.go +++ b/internal/api/auth_share.go @@ -1,7 +1,6 @@ package api import ( - "fmt" "net/http" "path" @@ -30,7 +29,7 @@ func Shares(router *gin.RouterGroup) { } clientConfig := conf.ClientShare() - clientConfig.SiteUrl = fmt.Sprintf("%ss/%s", clientConfig.SiteUrl, token) + clientConfig.SiteUrl = path.Join(clientConfig.SiteUrl, "s", token) uri := conf.BaseUri("/library/albums") c.HTML(http.StatusOK, "share.gohtml", gin.H{"shared": gin.H{"token": token, "uri": uri}, "config": clientConfig}) @@ -52,8 +51,8 @@ func Shares(router *gin.RouterGroup) { uid := links[0].ShareUID clientConfig := conf.ClientShare() - clientConfig.SiteUrl = fmt.Sprintf("%s/%s", clientConfig.SiteUrl, path.Join("s", token, uid)) - clientConfig.SitePreview = fmt.Sprintf("%s/preview", clientConfig.SiteUrl) + clientConfig.SiteUrl = path.Join(clientConfig.SiteUrl, "s", token, uid) + clientConfig.SitePreview = path.Join(clientConfig.SiteUrl, "preview") if a, err := query.AlbumByUID(uid); err == nil { clientConfig.SiteCaption = a.AlbumTitle