Skip to content

Commit 95072ab

Browse files
committed
clone req params
1 parent 48d3957 commit 95072ab

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

modules/storage/minio.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,11 @@ func (m *MinioStorage) Delete(path string) error {
276276
}
277277

278278
// URL gets the redirect URL to a file. The presigned link is valid for 5 minutes.
279-
func (m *MinioStorage) URL(path, name string, reqParams url.Values) (*url.URL, error) {
280-
if reqParams == nil {
281-
reqParams = make(url.Values)
279+
func (m *MinioStorage) URL(path, name string, serveDirectReqParams url.Values) (*url.URL, error) {
280+
// copy serveDirectReqParams
281+
reqParams, err := url.ParseQuery(serveDirectReqParams.Encode())
282+
if err != nil {
283+
return nil, err
282284
}
283285
// TODO it may be good to embed images with 'inline' like ServeData does, but we don't want to have to read the file, do we?
284286
reqParams.Set("response-content-disposition", "attachment; filename=\""+quoteEscaper.Replace(name)+"\"")

0 commit comments

Comments
 (0)