enhance(download): Use just-in-time host in download URl, instead of SiteURL in site settings

This commit is contained in:
Aaron Liu
2023-05-25 19:49:32 +08:00
parent 4c834e75fa
commit 4aafe1dc7a
16 changed files with 36 additions and 137 deletions

View File

@@ -300,8 +300,7 @@ func (fs *FileSystem) SignURL(ctx context.Context, file *model.File, ttl int64,
// 签名最终URL
// 生成外链地址
siteURL := model.GetSiteURL()
source, err := fs.Handler.Source(ctx, fs.FileTarget[0].SourceName, *siteURL, ttl, isDownload, fs.User.Group.SpeedLimit)
source, err := fs.Handler.Source(ctx, fs.FileTarget[0].SourceName, ttl, isDownload, fs.User.Group.SpeedLimit)
if err != nil {
return "", serializer.NewError(serializer.CodeNotSet, "Failed to get source link", err)
}