Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-28 04:36:11 +01:00

Merge pull request '[GITEA] Add download URL for executable files' (#1847) from Gusted/forgejo:forgejo-bp-1839-120 into v1.20/forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1847
This commit is contained in:
Gusted 2023-12-05 22:50:55 +00:00
commit 5528072d04

View file

@ -219,7 +219,7 @@ func GetContents(ctx context.Context, repo *repo_model.Repository, treePath, ref
}
}
// 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))
if err != nil {
return nil, err