fix(updateserver): only show downloadkey when downloads are gated #479
@@ -94,9 +94,9 @@ func ServeUpdatesXML(ctx *context.Context) {
|
||||
}
|
||||
|
||||
repoCfg, _ := licenses.GetRepoConfig(ctx, ctx.Repo.Repository.ID)
|
||||
// Show <downloadkey> when licensing is enabled (prepares Joomla to accept keys)
|
||||
// or when require_key is explicitly set.
|
||||
requireKey := repoCfg != nil && (repoCfg.LicensingEnabled || repoCfg.RequireKey)
|
||||
// Show <downloadkey> only when downloads are gated (prerelease or all).
|
||||
// No gating = no license keys needed = no downloadkey element.
|
||||
requireKey := repoCfg != nil && repoCfg.DownloadGating != "" && repoCfg.DownloadGating != "none"
|
||||
|
||||
xmlData, err := updateserver.GenerateJoomlaXML(ctx, ctx.Repo.Repository, requireKey, stripDownloads, allowedChannels...)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user