diff options
author | Earl Warren <109468362+earl-warren@users.noreply.github.com> | 2024-03-07 00:10:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-06 16:10:06 +0000 |
commit | f6d01ac2d89b326edd1169f25a5e946f025b0eb8 (patch) | |
tree | a983ec7d5adb2fdd28dde0295bb7318d14c4786a | |
parent | c996e359585597d8c86e57edf91ada1564e5106c (diff) | |
download | gitea-f6d01ac2d89b326edd1169f25a5e946f025b0eb8.tar.gz gitea-f6d01ac2d89b326edd1169f25a5e946f025b0eb8.zip |
Add download URL for executable files (#28260)
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.
Co-authored-by: Gusted <postmaster@gusted.xyz>
-rw-r--r-- | services/repository/files/content.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/services/repository/files/content.go b/services/repository/files/content.go index 9500b8f46d..95e7c7087c 100644 --- a/services/repository/files/content.go +++ b/services/repository/files/content.go @@ -220,7 +220,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 |