Skip to content

Commit f6d01ac

Browse files
earl-warrenGusted
andauthored
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 <[email protected]>
1 parent c996e35 commit f6d01ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

services/repository/files/content.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ func GetContents(ctx context.Context, repo *repo_model.Repository, treePath, ref
220220
}
221221
}
222222
// Handle links
223-
if entry.IsRegular() || entry.IsLink() {
223+
if entry.IsRegular() || entry.IsLink() || entry.IsExecutable() {
224224
downloadURL, err := url.Parse(repo.HTMLURL() + "/raw/" + url.PathEscape(string(refType)) + "/" + util.PathEscapeSegments(ref) + "/" + util.PathEscapeSegments(treePath))
225225
if err != nil {
226226
return nil, err

0 commit comments

Comments
 (0)