From 945188a0ba18ce983d279fb3b34025c22dab08a7 Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Thu, 29 Feb 2024 11:28:11 +1100 Subject: [PATCH] Fix images with , character not rendering (#4636) --- pkg/models/model_file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/models/model_file.go b/pkg/models/model_file.go index d32368508..6e4183aa0 100644 --- a/pkg/models/model_file.go +++ b/pkg/models/model_file.go @@ -202,7 +202,7 @@ func (f *BaseFile) Serve(fs FS, w http.ResponseWriter, r *http.Request) error { // Set filename if not previously set if w.Header().Get("Content-Disposition") == "" { - w.Header().Set("Content-Disposition", fmt.Sprintf("filename=%s", f.Basename)) + w.Header().Set("Content-Disposition", fmt.Sprintf(`filename="%s"`, f.Basename)) } http.ServeContent(w, r, f.Basename, f.ModTime, content)