mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	Download files to their original filename (#1676)
This commit is contained in:
		| @@ -7,6 +7,7 @@ package repo | |||||||
| import ( | import ( | ||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"io" | 	"io" | ||||||
|  | 	"path" | ||||||
| 	"strings" | 	"strings" | ||||||
|  |  | ||||||
| 	"code.gitea.io/git" | 	"code.gitea.io/git" | ||||||
| @@ -24,6 +25,7 @@ func ServeData(ctx *context.Context, name string, reader io.Reader) error { | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	ctx.Resp.Header().Set("Cache-Control", "public,max-age=86400") | 	ctx.Resp.Header().Set("Cache-Control", "public,max-age=86400") | ||||||
|  | 	name = path.Base(name) | ||||||
|  |  | ||||||
| 	// Google Chrome dislike commas in filenames, so let's change it to a space | 	// Google Chrome dislike commas in filenames, so let's change it to a space | ||||||
| 	name = strings.Replace(name, ",", " ", -1) | 	name = strings.Replace(name, ",", " ", -1) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user