From b9e16b36e5208dc7460af59d9e75dc8234caca27 Mon Sep 17 00:00:00 2001 From: Fionera Date: Thu, 2 May 2019 14:23:28 +0200 Subject: [PATCH] Fix Multipart upload check In the Documentation it states: // If (opts.MultipartParams or opts.MultipartContentName) and // opts.Body are set then CallJSON will do a multipart upload with a // file attached. --- lib/rest/rest.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rest/rest.go b/lib/rest/rest.go index bca249053..e26336560 100644 --- a/lib/rest/rest.go +++ b/lib/rest/rest.go @@ -393,7 +393,7 @@ func (api *Client) callCodec(opts *Opts, request interface{}, response interface opts.Body = bytes.NewBuffer(requestBody) } } - isMultipart := (opts.MultipartParams != nil || opts.MultipartMetadataName != "") && opts.Body != nil + isMultipart := (opts.MultipartParams != nil || opts.MultipartContentName != "") && opts.Body != nil if isMultipart { params := opts.MultipartParams if params == nil {