mirror of
https://github.com/stashapp/stash.git
synced 2025-12-16 20:07:05 +03:00
Add filename to image serve (#4616)
This commit is contained in:
@@ -199,6 +199,12 @@ func (f *BaseFile) Serve(fs FS, w http.ResponseWriter, r *http.Request) error {
|
||||
} else {
|
||||
w.Header().Set("Cache-Control", "no-cache")
|
||||
}
|
||||
|
||||
// Set filename if not previously set
|
||||
if w.Header().Get("Content-Disposition") == "" {
|
||||
w.Header().Set("Content-Disposition", fmt.Sprintf("filename=%s", f.Basename))
|
||||
}
|
||||
|
||||
http.ServeContent(w, r, f.Basename, f.ModTime, content)
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user