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.
This commit is contained in:
Fionera 2019-05-02 14:23:28 +02:00 committed by Nick Craig-Wood
parent b68c3ce74d
commit b9e16b36e5

View File

@ -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 {