mashape 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/http_client.rb +3 -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 handler.handleParams[:access_token] == nil || handler.handleParams[:access_secret] == nil
52
+ if url.start_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,11 +58,12 @@ 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 handler.handleParams[:access_token] == nil
61
+ if url.start_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]})
65
65
  end
66
+
66
67
  end
67
68
 
68
69
  Mashape::HttpUtils.setRequestHeaders(content_type, response_type, headers)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 0
8
- - 1
9
- version: 2.0.1
8
+ - 2
9
+ version: 2.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Mashape