Browser: Shared link has content-disposition header (#11712)

The shared link will be automatically downloadable when the user opens
the shared link in a browser.
This commit is contained in:
Anis Elleuch 2021-03-11 08:02:16 +01:00 committed by GitHub
parent c25e75f0b5
commit f92b7a5621
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2177,6 +2177,7 @@ func presignedGet(host, bucket, object string, expiry int64, creds auth.Credenti
query.Set(xhttp.AmzCredential, credential)
query.Set(xhttp.AmzDate, dateStr)
query.Set(xhttp.AmzExpires, expiryStr)
query.Set(xhttp.ContentDisposition, fmt.Sprintf("attachment; filename=\"%s\"", object))
// Set session token if available.
if sessionToken != "" {
query.Set(xhttp.AmzSecurityToken, sessionToken)