mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-01 13:44:06 +01:00
[GITEA] Add download URL for executable files
- Consider executable files as a valid case when returning a downloadURL for them. They are just regular files with the difference being the executable permission bit being set. - Not integration testing as it's not possible without adding adjusting the existing repositories to have a executable file. - Resolves https://codeberg.org/forgejo/forgejo/issues/1825 (cherry picked from commitca32891d54
) (cherry picked from commit72c9df8e45
) (cherry picked from commit0eae22d429
) (cherry picked from commitd37d0773bc
) (cherry picked from commitde4532a967
) (cherry picked from commitf5b41300a8
) (cherry picked from commitd3be0480b7
) (cherry picked from commitc72307fd3b
)
This commit is contained in:
parent
f88b58be3f
commit
71db593057
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue