-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Fix attachment download bug #27486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix attachment download bug #27486
Conversation
@@ -16,12 +13,7 @@ func WebAssetDownloadURL(repo *repo_model.Repository, attach *repo_model.Attachm | |||
} | |||
|
|||
func APIAssetDownloadURL(repo *repo_model.Repository, attach *repo_model.Attachment) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we even need the repo
param anymore now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these function could be removed. To keep this PR small, I need another refactor PR to do that.
} | ||
|
||
// /repos/{owner}/{repo}/releases/{id}/assets/{attachment_id} | ||
return setting.AppURL + "api/repos/" + repo.FullName() + "/releases/" + strconv.FormatInt(attach.ReleaseID, 10) + "/assets/" + strconv.FormatInt(attach.ID, 10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would happen to setting.AppURL + "api/repos/" + repo.FullName() + "/releases/" + strconv.FormatInt(attach.ReleaseID, 10) + "/assets/" + strconv.FormatInt(attach.ID, 10)
?
Should this handler be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it has been released, maybe deprecated is better.
Backport #27486 by @lunny Fix #27204 This PR allows `/<username>/<reponame>/attachments/<uuid>` access with personal access token and also changed attachments API download url to it so it can be download correctly. Co-authored-by: Lunny Xiao <[email protected]>
Backport #27486 by @lunny Fix #27204 This PR allows `/<username>/<reponame>/attachments/<uuid>` access with personal access token and also changed attachments API download url to it so it can be download correctly. Co-authored-by: Lunny Xiao <[email protected]>
* giteaofficial/main: [skip ci] Updated translations via Crowdin Fix attachment download bug (go-gitea#27486) Make actions default enabled for newly created repository if global configuraion enabled (go-gitea#27482) Fix the wrong HTTP response status code for duplicate packages (go-gitea#27480) Increase queue length (go-gitea#27555)
I was unable to create a backport for 1.20. @lunny, please send one manually. 🍵
|
I was unable to create a backport for 1.21. @lunny, please send one manually. 🍵
|
Fix #27204
This PR allows
/<username>/<reponame>/attachments/<uuid>
access with personal access token and also changed attachments API download url to it so it can be download correctly.