mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 08:02:36 +09:00 
			
		
		
		
	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>
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user