lib/auth0/mixins/httpproxy.rb in auth0-4.6.0 vs lib/auth0/mixins/httpproxy.rb in auth0-4.7.0
- old
+ new
@@ -19,10 +19,11 @@
# Make the call with extra_headers, if provided.
call(:get, url(safe_path), timeout, get_headers)
elsif method == :delete
call(:delete, url(safe_path), timeout, add_headers({params: body}))
elsif method == :post_file
+ body.merge!(multipart: true)
call(:post, url(safe_path), timeout, headers, body)
else
call(method, url(safe_path), timeout, headers, body.to_json)
end
case result.code
@@ -52,10 +53,16 @@
rescue JSON::ParserError
body
end
def call(method, url, timeout, headers, body = nil)
- RestClient::Request.execute(method: method, url: url, timeout: timeout, headers: headers, payload: body)
+ RestClient::Request.execute(
+ method: method,
+ url: url,
+ timeout: timeout,
+ headers: headers,
+ payload: body
+ )
rescue RestClient::Exception => e
case e
when RestClient::RequestTimeout
raise Auth0::RequestTimeout
else