oauth2-rails2 0.0.13b → 0.0.13c
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.
- data/lib/oauth2/client.rb +13 -3
- data/oauth2-rails2.gemspec +1 -1
- metadata +3 -3
data/lib/oauth2/client.rb
CHANGED
@@ -63,7 +63,7 @@ module OAuth2
|
|
63
63
|
resp = connection.run_request(verb, url, params, headers)
|
64
64
|
end
|
65
65
|
case resp.status
|
66
|
-
when 200
|
66
|
+
when 200..201
|
67
67
|
if json?
|
68
68
|
begin
|
69
69
|
ResponseHash.new(resp)
|
@@ -73,7 +73,7 @@ module OAuth2
|
|
73
73
|
else
|
74
74
|
ResponseString.new(resp)
|
75
75
|
end
|
76
|
-
when 301
|
76
|
+
when 301..302
|
77
77
|
if json?
|
78
78
|
begin
|
79
79
|
ResponseHash.new(resp)
|
@@ -87,10 +87,20 @@ module OAuth2
|
|
87
87
|
e = OAuth2::AccessDenied.new("Received HTTP 401 during request.")
|
88
88
|
e.response = resp
|
89
89
|
raise e
|
90
|
-
|
90
|
+
when 500
|
91
91
|
e = OAuth2::HTTPError.new("Received HTTP #{resp.status} during request.")
|
92
92
|
e.response = resp
|
93
93
|
raise e
|
94
|
+
else #If I can't trap it, it should still function
|
95
|
+
if json?
|
96
|
+
begin
|
97
|
+
ResponseHash.new(resp)
|
98
|
+
rescue StandardError => e
|
99
|
+
ResponseString.new(resp)
|
100
|
+
end
|
101
|
+
else
|
102
|
+
ResponseString.new(resp)
|
103
|
+
end
|
94
104
|
end
|
95
105
|
end
|
96
106
|
|
data/oauth2-rails2.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oauth2-rails2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 420914392
|
5
5
|
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 13c
|
10
|
+
version: 0.0.13c
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Bleigh
|