lib/hello_sign/client.rb in hellosign-ruby-sdk-3.2.1 vs lib/hello_sign/client.rb in hellosign-ruby-sdk-3.2.2

- old
+ new

@@ -49,11 +49,11 @@ include Api::UnclaimedDraft include Api::Embedded include Api::OAuth include Api::ApiApp - attr_accessor :end_point, :oauth_end_point, :api_version, :user_agent, :client_id, :client_secret, :email_address, :password, :api_key, :auth_token, :logging, :log_level + attr_accessor :end_point, :oauth_end_point, :api_version, :user_agent, :client_id, :client_secret, :email_address, :password, :api_key, :auth_token, :logging, :log_level, :proxy_uri, :proxy_user, :proxy_pass ERRORS = { 400 => Error::BadRequest, 401 => Error::Unauthorized, 402 => Error::PaidApiPlanRequired, @@ -161,10 +161,17 @@ connection.basic_auth api_key, '' elsif email_address connection.basic_auth email_address, password else end + if proxy_uri + connection.options.proxy = { + :uri => proxy_uri, + :user => proxy_user, + :password => proxy_pass + } + end connection end def validate(response) if response.status >= 400 @@ -223,10 +230,10 @@ elsif file.is_a? File mime_type = MIMEfromIO file opts[:"file[#{index}]"] = Faraday::UploadIO.new(file, mime_type) elsif defined? ActionDispatch::Http::UploadedFile if file.is_a? ActionDispatch::Http::UploadedFile - mime_type MIMEfromIO file + mime_type = MIMEfromIO file opts[:"file[#{index}]"] = UploadIO.new(file.tempfile, mime_type) end else raise HelloSign::Error::NotSupportedType.new "#{file.class} is not a supported. Must be a string or ActionDispatch::Http::UploadedFile" end