Merge pull request '[GITEA] Add download URL for executable files' (#1839) from Gusted/forgejo:forgejo-download-url-exec into forgejo-dependency

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1839
This commit is contained in:
Gusted 2023-11-28 18:01:47 +00:00
commit 8634479706

View file

@ -219,7 +219,7 @@ func GetContents(ctx context.Context, repo *repo_model.Repository, treePath, ref
} }
} }
// Handle links // Handle links
if entry.IsRegular() || entry.IsLink() { if entry.IsRegular() || entry.IsLink() || entry.IsExecutable() {
downloadURL, err := url.Parse(repo.HTMLURL() + "/raw/" + url.PathEscape(string(refType)) + "/" + util.PathEscapeSegments(ref) + "/" + util.PathEscapeSegments(treePath)) downloadURL, err := url.Parse(repo.HTMLURL() + "/raw/" + url.PathEscape(string(refType)) + "/" + util.PathEscapeSegments(ref) + "/" + util.PathEscapeSegments(treePath))
if err != nil { if err != nil {
return nil, err return nil, err