fix: include filename in Content-Disposition header for inline downloads (#5860)

This commit is contained in:
lif authored and GitHub committed 2026-03-28 19:03:07 +01:00
1 parent 0616f6811f
commit 8f81b77cf2
2 files changed
+77 -1

No files matched your search

+2 -1
View File
@@ -72,7 +72,8 @@ func parseQueryAlgorithm(r *http.Request) (string, archives.Archival, error) {
func setContentDisposition(w http.ResponseWriter, r *http.Request, file *files.FileInfo) {
if r.URL.Query().Get("inline") == "true" {
w.Header().Set("Content-Disposition", "inline")
// As per RFC6266 section 4.3
w.Header().Set("Content-Disposition", "inline; filename*=utf-8''"+url.PathEscape(file.Name))
} else {
// As per RFC6266 section 4.3
w.Header().Set("Content-Disposition", "attachment; filename*=utf-8''"+url.PathEscape(file.Name))