Skip to content

Fix tarball/zipball download bug #29342

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

Merged
merged 7 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions models/repo/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,14 @@ func (r *Release) APIURL() string {
return r.Repo.APIURL() + "/releases/" + strconv.FormatInt(r.ID, 10)
}

// ZipURL the zip url for a release. release must have attributes loaded
func (r *Release) ZipURL() string {
return r.Repo.HTMLURL() + "/archive/" + util.PathEscapeSegments(r.TagName) + ".zip"
// APIZipURL the zip api url for a release. release must have attributes loaded
func (r *Release) APIZipURL() string {
return r.Repo.APIURL() + "/archive/" + util.PathEscapeSegments(r.TagName) + ".zip"
}

// TarURL the tar.gz url for a release. release must have attributes loaded
func (r *Release) TarURL() string {
return r.Repo.HTMLURL() + "/archive/" + util.PathEscapeSegments(r.TagName) + ".tar.gz"
// APITarURL the tar.gz api url for a release. release must have attributes loaded
func (r *Release) APITarURL() string {
return r.Repo.APIURL() + "/archive/" + util.PathEscapeSegments(r.TagName) + ".tar.gz"
}

// HTMLURL the url for a release on the web UI. release must have attributes loaded
Expand Down
4 changes: 2 additions & 2 deletions services/convert/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ func ToAPIRelease(ctx context.Context, repo *repo_model.Repository, r *repo_mode
Note: r.Note,
URL: r.APIURL(),
HTMLURL: r.HTMLURL(),
TarURL: r.TarURL(),
ZipURL: r.ZipURL(),
TarURL: r.APITarURL(),
ZipURL: r.APIZipURL(),
UploadURL: r.APIUploadURL(),
IsDraft: r.IsDraft,
IsPrerelease: r.IsPrerelease,
Expand Down