summaryrefslogtreecommitdiffstats
path: root/app/file.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/file.go')
-rw-r--r--app/file.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/file.go b/app/file.go
index b678475c9..8c0960fe8 100644
--- a/app/file.go
+++ b/app/file.go
@@ -360,6 +360,11 @@ func MigrateFilenamesToFileInfos(post *model.Post) []*model.FileInfo {
func GeneratePublicLink(siteURL string, info *model.FileInfo) string {
hash := GeneratePublicLinkHash(info.Id, *utils.Cfg.FileSettings.PublicLinkSalt)
+ return fmt.Sprintf("%s/files/%v/public?h=%s", siteURL, info.Id, hash)
+}
+
+func GeneratePublicLinkV3(siteURL string, info *model.FileInfo) string {
+ hash := GeneratePublicLinkHash(info.Id, *utils.Cfg.FileSettings.PublicLinkSalt)
return fmt.Sprintf("%s%s/public/files/%v/get?h=%s", siteURL, model.API_URL_SUFFIX_V3, info.Id, hash)
}