mashape 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/http_client.rb +2 -2
- metadata +2 -2
data/lib/http_client.rb
CHANGED
@@ -49,7 +49,7 @@ module Mashape
|
|
49
49
|
elsif handler.kind_of? Mashape::QueryAuthentication
|
50
50
|
parameters = parameters.merge(handler.handleParams)
|
51
51
|
elsif handler.kind_of? Mashape::OAuth10aAuthentication
|
52
|
-
if url.
|
52
|
+
if url.end_with?("/oauth_url") == false && (handler.handleParams[:access_token] == nil || handler.handleParams[:access_secret] == nil)
|
53
53
|
raise Mashape::JsonException.new("Before consuming OAuth endpoint, invoke authorize('access_token','access_secret') with not null values")
|
54
54
|
end
|
55
55
|
# These headers will be processed by the proxy to sign the request
|
@@ -58,7 +58,7 @@ module Mashape
|
|
58
58
|
headers["x-mashape-oauth-accesstoken"] = handler.handleParams[:access_token]
|
59
59
|
headers["x-mashape-oauth-accesssecret"] = handler.handleParams[:access_secret]
|
60
60
|
elsif handler.kind_of? Mashape::OAuth2Authentication
|
61
|
-
if url.
|
61
|
+
if url.end_with?("/oauth_url") == false && handler.handleParams[:access_token] == nil
|
62
62
|
raise Mashape::JsonException.new("Before consuming OAuth endpoint, invoke authorize('access_token') with a not null value")
|
63
63
|
end
|
64
64
|
parameters = parameters.merge({"access_token" => handler.handleParams[:access_token]})
|