Skip to content

Commit 422d493

Browse files
authored
Fix obs object content disposition issue (go-gitea#9)
1 parent dc87440 commit 422d493

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/storage/hwcloud.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,14 @@ func (hwc *HWCloudStorage) CommitUpload(path, additionalParameter string) error
221221

222222
// URL gets the redirect URL to a file. The presigned link is valid for 5 minutes.
223223
func (hwc *HWCloudStorage) URL(path, name string) (*url.URL, error) {
224+
queryParameter := map[string]string{"response-content-disposition": "attachment; filename=\"" + quoteEscaper.Replace(name) + "\""}
224225
input := &obs.CreateSignedUrlInput{}
225226

226227
input.Method = obs.HttpMethodGet
227228
input.Bucket = hwc.bucket
228229
input.Key = hwc.buildMinioPath(path)
229230
input.Expires = default_expire
230-
231+
input.QueryParams = queryParameter
231232
output, err := hwc.hwclient.CreateSignedUrl(input)
232233
if err != nil {
233234
return nil, err

0 commit comments

Comments
 (0)