s3: use "response-content-disposition" to overwrite default content-disposition

fix one part of https://github.com/chrislusf/seaweedfs/issues/2371

see https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html
This commit is contained in:
Chris Lu 2021-10-11 23:29:52 -07:00
parent f0b928ff5e
commit 8e9273db99

View file

@ -250,6 +250,11 @@ func handleStaticResources2(r *mux.Router) {
}
func adjustHeaderContentDisposition(w http.ResponseWriter, r *http.Request, filename string) {
responseContentDisposition := r.FormValue("response-content-disposition")
if responseContentDisposition != "" {
w.Header().Set("Content-Disposition", responseContentDisposition)
return
}
if filename != "" {
contentDisposition := "inline"
if r.FormValue("dl") != "" {