Browse Source

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
pull/2376/head
Chris Lu 3 years ago
parent
commit
8e9273db99
  1. 5
      weed/server/common.go

5
weed/server/common.go

@ -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") != "" {

Loading…
Cancel
Save