From 51b617f6014869d339a22733b49365b75840464f Mon Sep 17 00:00:00 2001 From: Tim Gallant Date: Sat, 21 Mar 2020 14:56:11 -0700 Subject: [PATCH] yandex: pass options to rest.Opts for upload --- backend/yandex/yandex.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/yandex/yandex.go b/backend/yandex/yandex.go index 4fb9eb0b2..af134daa6 100644 --- a/backend/yandex/yandex.go +++ b/backend/yandex/yandex.go @@ -1065,7 +1065,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read return resp.Body, err } -func (o *Object) upload(ctx context.Context, in io.Reader, overwrite bool, mimeType string) (err error) { +func (o *Object) upload(ctx context.Context, in io.Reader, overwrite bool, mimeType string, options ...fs.OpenOption) (err error) { // prepare upload var resp *http.Response var ur api.AsyncInfo @@ -1073,6 +1073,7 @@ func (o *Object) upload(ctx context.Context, in io.Reader, overwrite bool, mimeT Method: "GET", Path: "/resources/upload", Parameters: url.Values{}, + Options: options, } opts.Parameters.Set("path", o.fs.opt.Enc.FromStandardPath(o.filePath())) @@ -1121,7 +1122,7 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op } //upload file - err = o.upload(ctx, in1, true, fs.MimeType(ctx, src)) + err = o.upload(ctx, in1, true, fs.MimeType(ctx, src), options...) if err != nil { return err }